From: Austin Ziegler Date: 2006-06-28T23:11:39+09:00 Subject: Re: Unicode roadmap? On 6/28/06, Dmitrii Dimandt wrote: > I wonder, what is wrong with making all strings Unicode by default > (this will ensure that most libraries don't automagically break once > Ruby is upgraded), _but_ let developers optionally decide whether they > want a different encoding: > > s = new String #=> unicode string > sj = new String(:encoding => 'jis') > scp = new String(:encoding => 'CP1251') > sb = new String(:binary => true) #=> work as ByteArray > sbf = new String(:encoding => 'funny encoding', :binary => true) #=> > work as ByteArray IIRC, any "unknown" encoding will be treated as a binary string where you're responsible for dealing with "characters". 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). -austin -- Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/ * austin@halostatue.ca * http://www.halostatue.ca/feed/ * austin@zieglers.ca