UTF-8 out of Hpricot

  • Thread starter Diogo do Nascimento
  • Start date
D

Diogo do Nascimento

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.
 
H

Hannes Rammer

Diogo said:
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")))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top