converting from iso-8559-1 to utf-8

M

Mikel Lindsaar

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
 
M

Mikel Lindsaar

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
 

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

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top