From: Rick DeNatale Date: 2010-02-24T00:03:09+09:00 Subject: Re: [ENCODING] UTF8 hell On Tue, Feb 23, 2010 at 9:41 AM, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: [ENCODING] UTF8 hell" >    on Tue, 23 Feb 2010 20:10:20 +0900, Xavier Noëlle writes: > > |self.each_byte {|b| print "#{b} "} => 109 233 100 105 99 97 108 115 > | > |233 is, AFAIK, a valid UTF8 character, but calling gsub(anything) (eg. > |self.gsub('ruby', 'zorglub')) on this string leads to: `gsub': invalid > |byte sequence in UTF-8 (ArgumentError). > > 233 is not a valid UTF-8 character.  The byte sequence for médicals is > <109 195 169 100 105 99 97 108 115>. 233 for e accent acute would be valid for ISO-8859-1 encoding, not UTF-8. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale