How can I convert a string from windows-1252 to utf-8 in Ruby?

前端 未结 5 2003
日久生厌
日久生厌 2020-12-03 12:04

I\'m migrating some data from MS Access 2003 to MySQL 5.0 using Ruby 1.8.6 on Windows XP (writing a Rake task to do this).

Turns out the Windows string data is encod

5条回答
  •  天涯浪人
    2020-12-03 12:52

    If you want to convert a file named win1252file, on a unix OS, run:

    $ iconv -f windows-1252 -t utf-8 win1252_file > utf8_file
    

    You should probably be able to do the same on Windows with cygwin.

提交回复
热议问题