UTF-8 out of Hpricot

Hey,
I’m trying to get some text out of an Hpricot Element but it’s not
giving me the correct encoding. The text displays alright when I
inspect the element.
I’ve already set $KCODE to ‘U’
Thks.

Diogo do Nascimento wrote:

Hey,
I’m trying to get some text out of an Hpricot Element but it’s not
giving me the correct encoding. The text displays alright when I
inspect the element.
I’ve already set $KCODE to ‘U’
Thks.

that works for me

f = open(http://google.de/)
f.rewind
doc = Hpricot(Iconv.conv('utf-8', f.charset, 

f.readlines.join("\n")))

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs