by
Wenton L. Davis
A lot of people nearly go into a panic when I try to explain to them that they can do a lot of things from the command line tht they can't do from all their pretty GUIs. It really isn't difficult to understand, but just to show everyone, here are some really useful command-line tools that can be used in many cases...
iconv is a convenient way of translating file formats for text files. To get a list of the many character encodings iconv understands (it's a LOT), type:
$> iconv -l
To use iconv, tell it which encoding the original form is, which encoding the output should be, what the input file is, and what the output file is:
$> iconv -f <from-encoding> -t <to-encoding> <infile> -o <outfile>
For example, listing.txt16 is a file encoded in UTF-16 Little Endian format, which you want converted to UTF-8, and save it in listing.txt:
$> iconv -f UTF-16LE -t UTF-8 listing.txt16 -o listing.txt