From: Marcin Raczkowski Date: 2008-09-30T23:34:06+09:00 Subject: Re: Reliable character encodings conversion you can use RChardet library, her'es what i use: require 'rchardet' class String def encoding @encoding ||= guess_encoding end def encoding=(new) @encoding = new end def convert_to(new) self.replace(Iconv.iconv(new, encoding, self)[0]) @encoding = new end def guess_encoding @encoding = CharDet.guess(self)["encoding"] end # this enables "foo".convert :us-ascii => :utf8 def convert(hash) from = hash.keys[0] to = hash[from] self.replace(Iconv.iconv(to, from, self)[0]) end end it handles translating preatty well :)