Hi,

On Tue, Oct 7, 2008 at 11:28 AM, Li Chen <chen_li3 / yahoo.com> wrote:
> I grap some info from a webpage. Sometimes I get some stranges
> characters as follows (by p):
>  To depart in a hurry; abscond:  \342\200\234Your horse
> has\nabsquatulated!\342\200\235 (Robert M. Bird) To die.
>
> or (by print):
> To depart in a hurry; abscond:  Your horse has absquatulated!
> (Robert M. Bird) To die.
>
> Any idea to to get rid of them?

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