From: Logan Capaldo Date: 2006-05-25T12:26:39+09:00 Subject: Re: How does one transform UTF-8 encoded characters to ASCII On May 24, 2006, at 11:13 PM, Wes Gamble wrote: > Logan Capaldo wrote: >> On May 24, 2006, at 9:36 PM, Sam Roberts wrote: >> >>> >>> >>> >> >> require 'iconv' >> from = 'UTF-8' >> to = 'CP1252' >> iconvertor = Iconv.new(from, to) >> s = "String in utf8" >> string_in_windows1252 = iconvertor.iconv(s) >> iconvertor.close > > Is CP1252 the correct name of the character encoding? I was using > windows-1252? > > Where is a list of the canonical names of character encodings? > Canonical depends on whether or not your using GNU libiconv [1] or the local implementation. If you used windows-1252 and it didn't throw an exception, you're probably ok. > Also, what is a BOM? > Byte order marker. Usually used with UTF-16 its an initial sequence of bytes to let a program now if the file is big or little endian. [1] http://www.gnu.org/software/libiconv/