[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

UTF-8 out of Hpricot

Diogo Terror

10/23/2008 1:35:00 PM


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.



1 Answer

Hannes Rammer

10/27/2008 3:51:00 PM

0

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://...)
f.rewind
doc = Hpricot(Iconv.conv('utf-8', f.charset,
f.readlines.join("\n")))
--
Posted via http://www.ruby-....