From: Austin Ziegler Date: 2006-06-26T14:49:56+09:00 Subject: Re: Unicode roadmap? On 6/25/06, Charles O Nutter wrote: > One clarification I'd like to add to this: I'm not saying that a ByteArray > needs to be added, but if you're going to treat String as a ByteArray, then > perhaps there should be another type for character vectors? There's no meaningful distinction between the division of ByteArray/String and String/CharString. I do *not* believe that this is a viable option. The *sole* argument in favour is that we could add a CharString to Ruby 1.8 -- but I believe that this would be stampeding us in the wrong direction. Even if CharString < String, there will be problems -- people already note that there are issues with subclasses of the built-in classes. > My only point about the dichotomy between string> and is that at some > level, they imply different behaviors, different APIs, different interfaces. > Perhaps the answer is not to change existing Ruby code to use a m17n String > while trying to retain byte array capabilities in the same time...but maybe > it's worth considering that the new behavior warrants a separate type? This is where I disagree with you completely. If I have a String that contains ISO-8859-15 data, it *happens* that s#byte_count and s#length are the same value. It differs with UTF-8 data, but the interpretation of a Character is, at best, a *trait* of the data being stored. I have *really* given this a lot of thought, and I really do think that Matz is right about this and that the people who want Unicode-native strings are wrong. This sort of sucks for JRuby because of problems with Java. But I do not think that Sun made the right decision with Java. If nothing else, they ended up backing a dead "standard" during the initial phases, and have had to hack out since then. > I know you (matz) want to break as much as possible with the 2.0 release, > but I still don't see the advantage of marrying the "byte array string" and > "char string" types in the same class when separate types and behaviors > would be more logical and break far less. It *isn't* more logical. It doubles the number of required APIs for IO. It *completely* complicates things from that perspective, with little value for the people who have to implement character-oriented data routines. -austin -- Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/ * austin@halostatue.ca * http://www.halostatue.ca/feed/ * austin@zieglers.ca