DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

iconv(1)


iconv -- code set conversion utility

Synopsis

iconv -f fromcode -t tocode [-m mode][file]

Description

iconv converts the characters or sequences of characters in file from one code set to another and writes the results to standard output. If no conversion exists for a particular character, the character is converted to the underscore (_) in the target code set.

Your system must have the appropriate data files for iconv to work. The Language Supplement package provides a large selection of these data files.

The required arguments fromcode and tocode identify the input and output code sets, respectively. If no file argument is specified on the command line, iconv reads the standard input.

The optional argument mode provides a further distinction between mappings. While all the modes are not all available for all the conversions, the following values of mode are defined:


d default
Any character that cannot be represented is mapped to ``_''.

b best fit with no expansion
Characters are mapped to the closest approximation without expansion, that is, all mappings are one to one.

e best fit with expansion
Characters are mapped to the closest approximation of that character in the target code set. Where necessary, a character is expanded to a sequence of characters.

p printer mode with overstriking
If there is a non-destructive space, overstriking may be used to display characters.

Examples

When the Language Supplement package is installed on your system, the following command line converts the contents of file mail1 from code set 8859 to 646fr and stores the results in file mail.local.

iconv -f 8859 -t 646fr mail1 > mail.local

Files


/usr/lib/iconv/iconv_data
lists the conversions supported

/usr/lib/iconv/*
conversion tables, if any

/usr/lib/locale/locale/LC_MESSAGES/uxmesg
language-specific message file (See LANG on environ(5).)

Errors

iconv returns 0 upon successful completion, non-zero otherwise.

References

iconv(3C), iconv_close(3C), iconv_open(3C), iconvh(5)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004