Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
User Commandsiconv(1)


NAME

 iconv - code set conversion utility

SYNOPSIS

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

DESCRIPTION

 

The iconv utility 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, it is converted to the underscore _ in the target code set.

The list of supported conversions and the locations of the associated conversion tables are provided in the iconv(5) manual page.

OPTIONS

 

The following options are supported:

-f fromcode
Identifies the input code set.
-t tocode
Identifies the output code set.

OPERANDS

 

The following operands are supported:

file
A path name of the input file to be translated. If file is omitted, the standard input is used.

EXAMPLES

 Example 1. Converting and storing files
 

The following example converts the contents of file mail1 from code set 8859 to 646fr and stores the results in file mail.local:
 
example% iconv -f 8859 -t 646fr mail1 > mail.local

ENVIRONMENT VARIABLES

 

See environ(5) for descriptions of the following environment variables that affect the execution of iconv: LC_CTYPE, LC_MESSAGES, and NLSPATH.

EXIT STATUS

 

The following exit values are returned:

0
Successful completion.
1
An error has occurred.

FILES

 
/usr/lib/iconv/*.so
conversion modules
/usr/lib/iconv/*.t
conversion tables
/usr/lib/iconv/iconv_data
list of conversions supported by conversion tables
/usr/lib/iconv/geniconvtbl/binarytables/*.bt
conversion binary tables

ATTRIBUTES

 

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
AvailabilitySUNWcsu

SEE ALSO

 

geniconvtbl(1), iconv(3C), geniconvtbl(4), attributes(5), environ(5), iconv(5), iconv_unicode(5)

NOTES

 

The iconv utility can use conversion modules (/usr/lib/iconv/*.so), conversion tables (/usr/lib/iconv/*.t), or conversion binary tables (/usr/lib/iconv/geniconvtbl/binarytables/*.bt) to do the code set conversion. The iconv utility uses iconv_open(3C) to see if a particular code set conversion is available in the iconv(3C) function. iconv_open(3C) first tries to find out if there is a conversion binary table and then if there is a conversion module. If neither is available in your system, iconv_open(3C) will return a failure code. Then, finally, iconv will search for a conversion table.

Refer to the /usr/share/man/man5/iconv_locale.5 manual page in the Asian localized releases for information on which code set conversions are supported. For example, the command
 
example% man -s 5 iconv_ja
would display the manual page describing the code set conversions that are supported for the Japanese locale.

Notice that the iconv_locale.5 manual page may not exist in your system, depending on which locale you chose to install during the system installation.


SunOS 5.9Go To TopLast Changed 29 Oct 1999

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.