tail head cat sleep
QR code linking to this page

Manual Pages  — ICONV


iconv – codeset conversion utility



iconv [-cs] -f from_name -t to_name [file ...]
iconv -f from_name [-cs] [-t to_name] [file ...]
iconv -t to_name [-cs] [-f from_name] [file ...]
iconv -l


The iconv utility converts the codeset of file (or from standard input if no file is specified) from codeset from_name to codeset to_name and outputs the converted text on standard output.

The following options are available:
  Prevent output of any invalid characters. By default, iconv outputs an "invalid character" specified by the to_name codeset when it encounts a character which is valid in the from_name codeset but does not have a corresponding character in the to_name codeset.
  Specifies the source codeset name as from_name.
  Lists available codeset names. Note that not all combinations of from_name and to_name are valid.
  Silent. By default, iconv outputs the number of "invalid characters" to standard error if they exist. This option prevents this behaviour.
  Specifies the destination codeset name as to_name.


The iconv utility exits 0 on success, and >0 if an error occurs.


Convert file.txt from IBM273 to UTF-8 and save the result to converted.txt:

    iconv -f IBM273 -t UTF-8 file.txt > converted.txt


mkcsmapper(1), mkesdb(1), iconv(3)


iconv conform to IEEE Std 1003.1-2008 ("POSIX.1").


iconv first appeared in NetBSD FreeBSD 9.0 .

ICONV (1) October 22, 2009

tail head cat sleep
QR code linking to this page

Please direct any comments about this manual page service to Ben Bullock. Privacy policy.

Using Unix is the computing equivalent of listening only to music by David Cassidy
— Rob Pike