From: Felipe Contreras Date: 2007-09-29T06:49:09+09:00 Subject: Re: Unicode On 9/21/07, Michal Suchanek wrote: > On 15/09/2007, Zephyr Pellerin wrote: > > I hate to discuss something related to the development timeline, I know > > its tenable, but When will it be reasonable to expect Unicode support > > from Ruby? > > Ruby has unicode support. Sort of. Regexes work in UTF-8 when $KCODE > is set to "U" (and the default is "N" even in UTF-8 locales, and if > you specify the -K option in the .rb file it overrides the option > specified on the command line, heh). > The non-regex methods do not work but you can convert the string with > str.scan(/./)[0] or str.unpack "U*", and use stuff like each, reverse, > [], ... > You have to remember to convert the string back, though. What about UTF-16? http://blogs.gnome.org/sudaltsov/2007/09/22/ruby-part2/ -- Felipe Contreras