DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

iconv(C)


iconv -- international codeset conversion

Syntax

iconv [-h] [-d] -f fromcodeset -t tocodeset [file...]

Description

The iconv command converts the encoding of characters in file from fromcodeset to tocodeset and writes the results on standard output. For example:
   iconv -f IS8859 -t IS6937 datafile
converts the file datafile from IS8859 encoding to IS6937 encoding, reads the conversion tables from <path-prefix>/conv/IS8859_IS6937, and writes the results to standard output.

The conversion tables are held in a file whose name and path are constructed like this:

<path-prefix>/conv/fromcodeset_tocodeset

where <path-prefix> defaults to /usr/lib/nls if and only if the environmental variable ICONV is not set.

Each line in the conversion table specifies a conversion from the first string to the second string on the same line. Spaces and tabs are used to delimit tokens, the \ character is used to escape the next character and to introduce (exactly) three digit octal constants. Blank lines and lines starting with a hash (#) are introduced.

   #       a sample conversion table
   #       fromcode     tocode
   

\# wasahash \040 wasablank string another\040string

Other available options are:

-h
Prints a usage message on standard error.

-d
Deletes any characters which are not listed in the conversion table (that is, invalid characters). The default is to pass through any invalid characters.

Notes

As the name of the file holding the conversion rules is made with the characters of fromcodeset, tocodeset and the character ``_'', there may be truncation of some significant characters of the file name in order to conform to the maximum file name length {NAME_MAX}.

Files

$ICONV/conv/fromcodeset_tocodeset
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005