The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

iconv - codeset conversion

 SYNOPSIS



iconv -f fromcode -t tocode [file...]

 DESCRIPTION

The iconv utility converts the encoding of characters in file from one codeset to another and writes the results to standard output.

Character encodings in either codeset may include single-byte values (for example, for the ISO 8859-1:1987 standard characters) or multi-byte values (for example, for certain characters in the ISO 6937:1983 standard). The results of specifying invalid characters in the input stream (either those that are not valid members of the fromcode or those that have no corresponding value in tocode) are specified in the system documentation.

 OPTIONS

The iconv utility supports the XBD specification, Utility Syntax Guidelines  . The following options are supported:
-f fromcode
Identify the codeset of the input file. Valid values for fromcode are specified in the system documentation.
-t tocode
Identify the codeset to be used for the output file. Valid values for tocode are specified in the system documentation.

 OPERANDS

The following operands are supported:
file
A pathname of the input file to be translated. If file is omitted, the standard input is used.

 STDIN

The standard input is used only if the file operand is omitted.

 INPUT FILES

The input file is a text file.

 ENVIRONMENT VARIABLES

The following environment variables affect the execution of iconv:
LANG
Provide a default value for the internationalisation variables that are unset or null. If LANG is unset or null, the corresponding value from the implementation-dependent default locale will be used. If any of the internationalisation variables contains an invalid setting, the utility will behave as if none of the variables had been defined.
LC_ALL
If set to a non-empty string value, override the values of all the other internationalisation variables.
LC_CTYPE
Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters in arguments). During translation of the file, this variable is superseded by the use of the fromcode option-argument.
LC_MESSAGES
Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.
NLSPATH
Determine the location of message catalogues for the processing of LC_MESSAGES .

 ASYNCHRONOUS EVENTS

Default.

 STDOUT

The standard output is a text file containing the translated data.

 STDERR

Used only for diagnostic messages.

 OUTPUT FILES

None.

 EXTENDED DESCRIPTION

None.

 EXIT STATUS

The following exit values are returned:
0
Successful completion.
>0
An error occurred.

 CONSEQUENCES OF ERRORS

Default.

 APPLICATION USAGE

None.

 EXAMPLES

The following example converts the contents of file mail.x400 from the ISO 6937:1983 standard codeset to the ISO 8859-1:1987 standard codeset, and stores the results in file mail.local:

iconv -f IS6937 -t IS8859 mail.x400 > mail.local

 FUTURE DIRECTIONS

None.

 SEE ALSO

gencat.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]