Even in times where UTF-8 has been arrived and is used and supported by a broad range of systems, you will still have to treat files in a lot of different encodings. Especially in data processing systems you will have to import and export files in several different encodings.

On linux/unix systems this can be easily supported with iconv provided by the operating system. Simply call

iconv -f iso-8859-1 -t utf-8 source-file.txt > target-file.txt

to convert form iso-8859-1 to utf-8 or use

iconv -f utf-8 -t iso-8859-1 source-file.txt > target-file.txt

to convert the other way around (-t is the abbreviation for “to” and identifies the encoding of the target files; -f is the abbreviation for “from” and represents the encoding of the source file)

On windows, iconv is not available out of the box, but instead of installing additional editors or other tools, you can simply install the precompiled binaries of iconv provided by the GunWin32 project: http://gnuwin32.sourceforge.net/packages/libiconv.htm
There are downloads for source, bins and also a ready to use installer providing a wizard to setup iconv on your windows operating systems.

If you have installed the tool, you can simply start a new command line and run iconv as described above for linux systems.

Converting File Encodings on Windows

Post navigation

Leave a Reply