[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

converting from iso-8559-1 to utf-8

Mikel Lindsaar

2/4/2008 8:57:00 AM

Hey all,

I am rendering onto a web page a file that has a iso-8559-1 character
set, Rails sends out data as UTF-8, so i am getting character mapping
errors.

I thought the most straightforward solution would be to convert the
input file text into UTF-8 first, then pass it over to rails to fire
out as UTF-8.

I thought I could do (summary code):

trans = Iconv.new('UTF-8', 'ISO-8559-1')
input_text = File.read('filename')
output_text = trans.iconv(input_text)

But I get an unsupported encoding error on my Mac and Windows.

How do y'all convert this iso-8559-1 charset?


Regards


Mikel

1 Answer

Mikel Lindsaar

2/4/2008 3:20:00 PM

0

On Feb 4, 2008 7:56 PM, Mikel Lindsaar <raasdnil@gmail.com> wrote:
> How do y'all convert this iso-8559-1 charset?

Never mind.. the way you do it is SPELL THE CHARACTER ENCODING CORRECTLY.

It is 8859, not 8559.

Hurumpf :)

Mikel