how to do charset conversion in ruby?

F

femtowin femtowin

hello all,
say I've get a file encoding in GB2312,
how do I convert it to UTF-8?
 
F

femtowin femtowin

require 'iconv'
conv =3D Iconv.new("UTF16","ISO88591")
result =3D conv.iconv("hello")

but it reports: No such file to load -- iconv,
I'm under windows.
and the manual says Iconv is a wrapper class for the UNIX 95 iconv()
function family,so is that iconv must be used under UNIX/LINUX?
or should I install something?
 

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

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top