From: nobu.nokada@... Date: 2003-12-20T08:43:09+09:00 Subject: Re: string to UTF Hi, At Sat, 20 Dec 2003 02:56:55 +0900, Mark J. Reed wrote: > Which isn't much of a test since the UTF-8 of "test" is just "test". > This is a better demonstration: > > irb(main):004:0> convertor.iconv("�Hola!") > => "\302\241Hola!" > > The two-byte sequence "\302\241" - that is, a byte whose value is > octal 302 = decimal 194 = hexadecimal C2 followed by a byte whose value is > octal 241 = decimal 161 = hexadecimal A1, is, in fact, the UTF-8 encoding > of the character U+00A1 INVERTED EXCLAMATION MARK. Only for ISO-8859-1, iconv is not needed. $ ruby -e 'p "\xa1Hola!".unpack("C*").pack("U*")' "\302\241Hola!" -- Nobu Nakada