iconv - charset conversion utility
iconv -f from_charset -t to_charset [
-s inputstring | file... ]
The iconv utility converts the characters or sequences of characters in
file(s) (or inputstring if specified with the -s option)
from one charset to another and writes the results to standard output. Should
no conversion exist for a particular character then it is converted to the
underscore '_' in the target charset.
The list of supported conversions and the locations of the
associated conversion tables are provided in the iconv(3) manual
page.
The following options are supported:
- -f from_charset
- Identifies the input charset.
- -t to_charset
- Identifies the output charset.
- -s inputstring
- Identifies the character sequence, which is to be converted instead of
input files.
The following operands are supported:
- file(s)
- A list of the input files to be translated. '-' means the standard
input. If file is omitted, the standard input is used.
The following example converts the contents of file mail1 from charset
iso-8859-5 to utf-8 and stores the results in file
mail.local.
example% iconv -f iso-8859-5 -t utf-8 mail1 > mail.local
See iconv(3) for the description of the ICONV_PATH environment
variable that affects the behaviour of iconv.
The following exit values are returned:
- 0
- Successful completion.
- 1
- An error has occurred.