From: Richard Gyger Date: 2006-03-10T11:19:42+09:00 Subject: Re: unicode in ruby exactly. utf-8 doesn't mean one byte per char necessarily. how have folks solved this problem when writing web sites in rails? Michal Suchanek wrote: >On 3/8/06, Logan Capaldo wrote: > > >>On Mar 8, 2006, at 1:13 PM, Richard Gyger wrote: >> >> >> >>>so, you guys are telling me a language developed since the year >>>2000 doesn't support unicode strings natively? in my opinion, >>>that's a pretty glaring problem. >>> >>> >>> >>Ruby doesn't really support any strings natively. It just happens to >>have a bytevector class that acts a lot like a string ;) Having said >>that, have you tried: >>$KCODE="u" # Assumes the source file is encoded as UTF8, effects >>literal strings, regexps, etc. >> >>If your source file is UTF16 or some other non-UTF8 encoding you'll >>have to use iconv to get into UTF8 to compare with the literals in >>your source. >> >> > >err, no that is not what people want when they speak about downcase in unicode. >Sure, you can write a string encoded in utf-8 in your source, and >verify it is byte-identical to another string. That is about all you >get this way. >I suspect regexps won't work right with multibyte characters, for >downcase or case -insensitive regexps you would even need to know the >language. > >Thanks > >Michal > > >-- > Support the freedom of music! >Maybe it's a weird genre .. but weird is *not* illegal. >Maybe next time they will send a special forces commando >to your picnic .. because they think you are weird. > www.music-versus-guns.org http://en.policejnistat.cz > >