From: Yukihiro Matsumoto Date: 2010-02-23T23:41:25+09:00 Subject: Re: [ENCODING] UTF8 hell 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>. matz.