From: Austin Ziegler Date: 2006-06-29T03:23:24+09:00 Subject: Re: Unicode roadmap? On 6/28/06, Julian 'Julik' Tarkhanov wrote: > On 28-jun-2006, at 19:12, Yukihiro Matsumoto wrote: >> In message "Re: Unicode roadmap?" >> on Wed, 28 Jun 2006 23:11:39 +0900, "Austin Ziegler" >> writes: >>| I have suggested to Matz that we adopt the u"string" format so that >>| we have a literal constructor for Unicode strings (which is by far >>| the more common need). >> I am not sure how much this is more useful than usual string literals >> plus unicode encoding pragma. > Austin, I don't understand why my strings are more "special" than > yours and thus need subclassing, Excuse me? I'm not the one who has been advocating separate classes. I have, however, suggested that Unicode strings are going to be common enough that rather than saying String.new("unicode-string", encoding: :utf8) we have u"unicode-string". I *already* know that binary string literals are quite common in Ruby. I use them a lot. And I mix them with strings that would logically be represented in Unicode. If, however, you would prefer doing it the other way, we could go: raise "UnicodeString" unless a[0, 8] == b"binarystring" Either way, I don't care. But neither needs to be a separate class. But they should be mixable, and the pragma wouldn't make things easily mixable. > special encoding or a special literal before them. This is by far the > worst thing I fear - that multibyte strings are handled as being > "special". They are not special, they are the default. No, actually, they're *possibly* the default. More to the point, *UNICODE* strings are not even necessarily going to be the default with multibyte strings. So *even so* I would suggest that this might be useful: raise u"UnicodeString" unless a[0, 8] == b"binarystring" "other-multibyte-string-according-to-pramga" > With the pragma there is one thing which makes me wonder - will that > mean that the libraries will have to check for the pragma to do their > job correctly? I think the pragma is going to be a problem for mixed-content strings. -austin -- Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/ * austin@halostatue.ca * http://www.halostatue.ca/feed/ * austin@zieglers.ca