From: Yukihiro Matsumoto Date: 2011-01-07T09:21:37+09:00 Subject: Re: From UTF-8 to windows-1252 Hi, In message "Re: From UTF-8 to windows-1252" on Fri, 7 Jan 2011 03:53:26 +0900, "Y. NOBUOKA" writes: |Although an encoding of the data from the DB is UTF-8, ruby doesn't |know the encoding, so you must do tell ruby the encoding before |encoding to Windows-1252. | | # tell ruby the encoding | mydata.force_encoding( "UTF-8" ) | # encode to windows-1252 | mydata.encode( "windows-1252" ) For the record, you don't have to use force_encoding: mydata.encode("windows-1252", "UTF-8") matz.