On Jan 10, 2008, at 10:55 PM, Yukihiro Matsumoto wrote:

> I don't think there's no string in Ruby without encoding.  Every
> string has their own encoding.  Allowing nil is pretty easy, but if it
> encourage the false conception (like you had), it might be better to
> remove it from long range view.  Let me think.


I'm certainly not an expert on encoding, so take this with a grain of  
salt, but it seems to be that there _is_ a different between a string  
tagged ASCII-8BIT and a string with no encoding. A string with no  
encoding should remain unchanged under operations such as #upcase,  
whereas upcase on an ASCII-8BIT string could return a string with  
different content.

Or, looking at it another way, a string with no encoding contains  
bytes but no characters.

Of course, if that's the interpretation, then "cat".force_encoding(nil) 
[0] should throw an exception, so maybe that's too big a change... :)


Dave