bash iconv - ghdrako/doc_snipets GitHub Wiki

iconv

converts a UTF 8 encoded file foo.txt into a latin 1 encoded file named foo.latin1.txt.

iconv -f UTF8 -t LATIN1 foo.txt > foo.latin1.txt
 echo toto | iconv -f UTF-8 -t IBM-852

iconv program converts the encoding of characters in inputfile from one coded character set to another. The result is written to standard output unless otherwise specified by the --output option.

  • --from-code, -f encoding Convert characters from encoding
  • --to-code, -t encoding Convert characters to encoding
  • --list List known coded character sets
  • --output, -o file Specify output file (instead of stdout)
  • --verbose Print progress information.
iconv -f ISO-8859-2 -t UTF-8//TRANSLIT -o out.txt in.txt