From: Li Chen Date: 2008-10-08T23:24:10+09:00 Subject: Re: how to remove strange characters Stephen Celis wrote: > Those are multi-byte characters (curly quotes, in this case). You > probably don't want to get rid of them, but you can use the iconv > library to transliterate them back to their ASCII almost-equivalents: > >>> string = "To depart in a hurry; abscond: \342\200\234Your horse has\nabsquatulated!\342\200\235 (Robert M. Bird) To die." > => "To depart in a hurry; abscond: \342\200\234Your horse > has\nabsquatulated!\342\200\235 (Robert M. Bird) To die." >>> require 'iconv' > => true >>> puts Iconv.iconv('ascii//translit', 'utf-8', string).to_s > To depart in a hurry; abscond: "Your horse has > absquatulated!" (Robert M. Bird) To die. > => nil > > Stephen Thank you, Li -- Posted via http://www.ruby-forum.com/.