UTF-8 out of Hpricot


#1

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.


#2

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")))