National Language Support (NLS) provides a base for internationalization in which data often can be changed from one code set to another. Support of several standard converters for this purpose is provided. This section discusses the following aspects of conversion:
Data sent by one program to another program residing on a remote host may require conversion from the code set of the source machine to that of the receiver. For example, when communicating with a VM system, the workstation converts its ISO8859-1 data to an EBCDIC form.
Code sets define graphic characters and control character assignments to code points. These coded characters must also be converted when a program obtains data in one code set but displays it in another code set.
Two interfaces for conversions are provided:
iconv command | Allows you to request a specific conversion by naming the FromCode and ToCode code sets. |
libiconv functions | Allow applications to request converters by name. |
The system provides ready-to-use libraries of converters. You supply the name of the converter you want to use. The converter libraries are found in the /usr/lib/nls/loc/iconv/* and /usr/lib/nls/loc/iconvTable/* directories.
In addition to code set converters, the converter library also provides a set of network interchange converters. In a network environment, the code sets of the communications systems and the protocols of communication determine how the data should be converted.
Interchange converters are used to convert data sent from one system to another. Conversions from one internal code set to another require code set converters. When data must be converted from a sender's code set to a receiver's code set or from 8-bit data to 7-bit data, a uniform interface is required. The iconv subroutines provide this interface.
The system supports standard converters for use with the iconv command and subroutines. The following list describes the different types of converters:
Code Set Converter Types | Description |
---|---|
Table converter | Converts single-byte stateless code sets. Performs a table translation from one byte to another byte. |
Algorithmic converter | Performs a conversion that cannot be implemented using a simple single-byte mapping table. All multibyte converters are currently implemented in this way. |
Interchange Converter Types | Description |
---|---|
7-bit converter | Converts between internal code sets and ISO2022 standard interchange formats (7-bit). |
8-bit converter | Converts between internal code sets and ISO2022 standard interchange formats (8-bit). |
Compound Text converter | Converts between compound text and internal code sets. |
uucode converter | Provides the same mapping as that defined in the uuencode and uudecode command. |
UCS-2 converters | Converts between UCS-2 and other code sets. |
UTF-8 converters | Converts between UTF-8 and other code sets. |
Miscellaneous Converters | Description |
---|---|
Miscellaneous converters | Used by some of the converters listed above. |
The iconv application programming interface (API) consists of three subroutines that accomplish conversion:
iconv_open | Performs the initialization required to convert characters from the code set specified by the FromCode parameter to the code set specified by the ToCode parameter. The strings specified are dependent on the converters installed in the system. If initialization is successful, the converter descriptor, iconv_t, is returned in its initial state. |
iconv | Invokes the converter function using the descriptor obtained from the iconv_open subroutine. The inbuf parameter points to the first character in the input buffer, and the inbytesleft parameter indicates the number of bytes to the end of the buffer being converted. The outbuf parameter points to the first available byte in the output buffer, and the outbytesleft parameter indicates the number of available bytes to the end of the buffer.
For state-dependent encoding, the subroutine is placed in its initial state by a call for which the inbuf value is a null pointer. Subsequent calls with the inbuf parameter as something other than a null pointer cause the internal state of the function to be altered as necessary. |
iconv_close | Closes the conversion descriptor specified by the cd variable and makes it usable again. |
In a network environment, two factors determine how data should be converted:
The following table outlines the conversion methods and recommends how you should convert data in different situations. See the "List of Interchange Converters--7-bit" and the "List of Interchange Converters--8-bit" for more information.
Outline of Methods and Recommended Choices | ||||
Communication with system using the same code set | Communication with system using different code set or receiver's code set is unknown | |||
Protocol | Protocol | |||
Method to choose | 7-bit only | 8-bit | 7-bit only | 8-bit |
as is | Not valid | Best choice | Not valid | Not valid if remote code set is unknown |
fold7 | OK | OK | Best choice | OK |
fold8 | Not valid | OK | Not valid | Best choice |
uucode | Best choice | OK | Not valid | Not valid |
If the sender uses the same code set as the receiver, there are two possibilities:
uucode method | Provides the same mapping as the uuencode and uudecode commands. This is the recommended method. |
fold7 method | Converts internal code sets using 7-bit data. This method passes ASCII without any change. |
If the sender uses a code set different from the receiver, there are two possibilities:
fold8 method | Converts internal code sets to standard interchange formats. The 8-bit data is transmitted and the information is preserved so that the receiver can reconstruct the data in its code set. |
The following examples illustrate how to use the iconv_open subroutine in different situations:
If the protocol allows 8-bit data, you can send data without converting it.
If the protocol allows only 7-bit data, do the following:
Sender: cd = iconv_open("uucode", nl_langinfo(CODESET)); Receiver: cd = iconv_open(nl_langinfo(CODESET), "uucode");
If the protocol allows 8-bit data and the receiver's code set is unknown, do the following:
Sender: cd = iconv_open("fold8", nl_langinfo(CODESET)); Receiver: cd = iconv_open(nl_langinfo(CODESET),"fold8" );If the protocol allows only 7-bit data, do the following:
Sender: cd = iconv_open("fold7", nl_langinfo(CODESET)); Receiver: cd = iconv_open(nl_langinfo(CODESET), "fold7" );
The iconv_open subroutine uses the LOCPATH environment variable to search for a converter whose name is in the form:
iconv/FromCodeSet_ToCodeSet
The FromCodeSet string represents the sender's code set, and the ToCodeSet string represents the receiver's code set. The underscore character separates the two strings.
Note: All setuid and setgid programs will ignore the LOCPATH environment variable.
Since the iconv converter is aloadable object module, a different object is required when running in the 64-bit environment. In the 64-bit environment, the iconv_open routine will use the LOCPATH environment variable to search for a converter whose name is in the form:
iconv/FromCodeSet_ToCodeSet__64.
The iconv library will automatically choose whether to load the standard converter object or the 64-bit converter object.
If the iconv_open subroutine does not find the converter, it uses the from,to pair to search for a file that defines a table-driven conversion. The file contains a conversion table created by the genxlt command.
The iconvTable converter uses the LOCPATH environment variable to search for a file whose name is in the form:
iconvTable/FromCodeSet_ToCodeSet
If the converter is found, it performs a load operation and is initialized. The converter descriptor, iconv_t, is returned in its initial state.
Converter programs are executable functions that convert data according to a set of rules. Converter tables are single-byte conversion tables that perform stateless conversions. Programs and tables are in separate directories:
/usr/lib/nls/loc/iconv | Converter programs |
/usr/lib/nls/loc/iconvTable | Converter tables. |
After a converter program is compiled and linked with the libiconv.a library, the program is placed in the /usr/lib/nls/loc/iconv directory.
To build a table converter, build a source converter table file. Use the genxlt command to compile translation tables into a format understood by the table converter. The output file is then placed in the /usr/lib/nls/loc/iconvTable directory.
Unicode (or UCS-2) conversion tables are found in:
$LOCPATH/uconvTable/*CodeSet*
The $LOCPATH/uconv/UCSTBL converter program is used to perform the conversion to and from UCS-2 using the iconv utilities. For the iconv utilities to use these uconvTable conversion tables, links must be set up within the $LOCPATH/iconv directory, for example, for code set "X."
ln -s /usr/lib/nls/loc/uconv/UCSTBL /usr/lib/nls/loc/iconv/X_UCS-2 ln -s /usr/lib/nls/loc/uconv/UCSTBL /usr/lib/nls/loc/iconv/UCS-2_X
A "Universal converter" program is provided that can be used to convert between any two code sets whose conversions to and from UCS-2 is defined. Given the following uconvTables:
X -> UCS-2 UCS-2 -> Y
a universal conversion can be defined that maps
X -> UCS-2 -> Y
by use of the $LOCPATH/iconv/Universal_UCS_Conv. The conversion X->Y is set by defining links to the universal converter, for example:
ln-s /usr/lib/nls/loc/iconv/Universal_UCS_Conv /usr/lib/nls/loc/iconv/X_Y
The iconv interface is a set of subroutines used to open, perform, and close conversions:
The following example shows how you can use these subroutines to create a code set conversion filter that accepts the ToCode and FromCode parameters as input arguments:
#include <stdio.h> #include <nl_types.h> #include <iconv.h> #include <string.h> #include <errno.h> #include <locale.h> #define ICONV_DONE() (r>=0) #define ICONV_INVAL() (r<0) && (errno==EILSEQ)) #define ICONV_OVER() (r<0) && (errno==E2BIG)) #define ICONV_TRUNC() (r<0) && (errno==EINVAL)) #define USAGE 1 #define ERROR 2 #define INCOMP 3 char ibuf[BUFSIZ], obuf[BUFSIZ]; extern int errno; main (argc,argv) int argc; char **argv; {
size_t ileft,oleft; nl_catd catd; iconv_t cd; int r; char *ip,*op; setlocale(LC_ALL,""); catd = catopen (argv[0],0); if(argc!=3){ fprintf(stderr, catgets (catd,NL_SETD,USAGE,"usage;conv fromcode tocode\n")); exit(1); } cd=iconv_open(argv[2],argv[1]); ileft=0; while(!feof(stdin)) {
/* * After the next operation,ibuf will * contain new data plus any truncated * data left from the previous read. */ ileft+=fread(ibuf+ileft,1,BUFSIZ-ileft,stdin); do { ip=ibuf; op=obuf; oleft=BUFSIZ; r=iconv(cd,&ip,&ileft,&op,&oleft); if(ICONV_INVAL()){ fprintf(stderr, catgets(catd,NL_SETD,ERROR,"invalid input\n")); exit(2); } fwrite(obuf,1,BUFSIZ-oleft,stdout); if(ICONV_TRUNC() || ICONV_OVER()) /* *Data remaining in buffer-copy *it to the beginning */ memcpy(ibuf,ip,ileft); /* *loop until all characters in the input *buffer have been converted. */ } while(ICONV_OVER()); } if(ileft!=0){ /* *This can only happen if the last call *to iconv() returned ICONV_TRUNC, meaning *the last data in the input stream was *incomplete. */ fprintf(stderr,catgets(catd,NL_SETD,INCOMP,"input incomplete\n")); exit(3); } iconv_close(cd); exit(0); }
Code set names are in the form CodesetRegistry-CodesetEncoding where:
The from,to variable used by the iconv command and iconv_open subroutine identifies a file whose name should be in the form /usr/lib/nls/loc/iconv/%f_%t or /usr/lib/nls/loc/iconvTable/%f_%t, where:
%f | Represents the FromCode set name. |
%t | Represents the ToCode set name. |
Converters change data from one code set to another. The sets of converters supported with the ICONV library are in the following sections. All converters shipped with the BOS Runtime Environment are located in the /usr/lib/nls/loc/iconv/* or /usr/lib/nls/loc/iconvTable/* directory.
These directories also contain private converters; that is, they are used by other converters. However, users and programs should only depend on the converters in the following lists.
Any converter shipped with the BOS Runtime Environment and not listed here should be considered private and subject to change or deletion. Converters supplied by other products can be placed in the /usr/lib/nls/loc/iconv/* or /usr/lib/nls/loc/iconvTable/* directory.
Programmers are encouraged to use registered code set names or code set names associated with an application. The X Consortium maintains a registry of code set names for reference. See the "Code Set Overview" for more information about code sets.
These converters provide conversion between PC, ISO, and EBCDIC single-byte stateless code sets. The following types of conversions are supported: PC to/from ISO, PC to/from EBCDIC, and ISO to/from EBCDIC.
Conversion is provided between compatible code sets such as Latin-1 to Latin-1 and Greek to Greek. However, conversion between different EBCDIC national code sets is not supported. For information about converting between incompatible character sets refer to the "List of Interchange Converters--7-bit" and the "List of Interchange Converters--8-bit" .
Conversion tables in the iconvTable directory are created by the genxlt command.
The following table lists code set names that are compatible. Each line defines to/from strings that may be used when requesting a converter.
Note: The PC and ISO code sets are ASCII-based.
Code Set Compatibility | ||||
Character Set | Languages | PC | ISO | EBCDIC |
---|---|---|---|---|
Latin-1 | U.S. English, Portuguese, Canadian French | IBM-850 | ISO8859-1 | IBM-037 |
Latin-1 | Danish, Norwegian | IBM-850 | ISO8859-1 | IBM-277 |
Latin-1 | Finnish, Swedish | IBM-850 | ISO8859-1 | IBM-278 |
Latin-1 | Italian | IBM-850 | ISO8859-1 | IBM-280 |
Latin-1 | Japanese | IBM-850 | ISO8859-1 | IBM-281 |
Latin-1 | Spanish | IBM-850 | ISO8859-1 | IBM-284 |
Latin-1 | U.K. English | IBM-850 | ISO8859-1 | IBM-285 |
Latin-1 | German | IBM-850 | ISO8859-1 | IBM-273 |
Latin-1 | French | IBM-850 | ISO8859-1 | IBM-297 |
Latin-1 | Belgian, Swiss German | IBM-850 | ISO8859-1 | IBM-500 |
Latin-2 | Croatian, Czechoslovakian, Hungarian, Polish, Romanian, Serbian Latin, Slovak, Slovene | IBM-852 | ISO88859-2 | IBM-870 |
Cyrillic | Bulgarian, Macedonian, Serbian Cyrillic, Russian | IBM-855 | ISO8859-5 | IBM-880 IBM-1025 |
Cyrillic | Russian | IBM-866 | ISO8859-5 | IBM-1025 |
Hebrew | Hebrew | IBM-856 IBM-862 | ISO8859-8 | IBM-424 IBM-803 |
Turkish | Turkish | IBM-857 | ISO8859-9 | IBM-1026 |
Arabic | Arabic | IBM-864 IBM-1046 | ISO8859-6 | IBM-420 |
Greek | Greek | IBM-869 | ISO8859-7 | IBM-875 |
Greek | Greek | IBM-869 | ISO8859-7 | IBM-875 |
Baltic | Lithuanian, Latvian, Estonian | IBM-921 IBM-922 | IBM-1112 IBM-1122 |
Note: A character that exists in the source code set but does not exist in the target code set is converted to a converter-defined substitute character.
The following table describes the inconvTable converters found in the /usr/lib/nls/loc/iconvTable directory:
iconvTable Converters | ||
Converter Table | Description | Language |
---|---|---|
IBM-037_IBM-850 | IBM-037 to IBM-850 | U.S. English, Portuguese, Canadian-French |
IBM-273_IBM-850 | IBM-273 to IBM-850 | German |
IBM-277_IBM-850 | IBM-277 to IBM-850 | Danish, Norwegian |
IBM-278_IBM-850 | IBM-278 to IBM-850 | Finnish, Swedish |
IBM-280_IBM-850 | IBM-280 to IBM-850 | Italian |
IBM-281_IBM-850 | IBM-281 to IBM-850 | Japanese-Latin |
IBM-284_IBM-850 | IBM-284 to IBM-850 | Spanish |
IBM-285_IBM-850 | IBM-285 to IBM-850 | U.K. English |
IBM-297_IBM-850 | IBM-297 to IBM-850 | French |
IBM-420_IBM_1046 | IBM-420 to IBM-1046 | Arabic |
IBM-424_IBM-856 | IBM-424 to IBM-856 | Hebrew |
IBM-424_IBM-862 | IBM-424 to IBM-862 | Hebrew |
IBM-500_IBM-850 | IBM-500 to IBM-850 | Belgian, Swiss German |
IBM-803_IBM-856 | IBM-803 to IBM-856 | Hebrew |
IBM-803_IBM-862 | IBM-803 to IBM-862 | Hebrew |
IBM-850_IBM-037 | IBM-850 to IBM-037 | U.S. English, Portuguese, Canadian-French |
IBM-850_IBM-273 | IBM-850 to IBM-273 | German |
IBM-850_IBM-277 | IBM-850 to IBM-277 | Danish, Norwegian |
IBM-850_IBM-278 | IBM-850 to IBM-278 | Finnish, Swedish |
IBM-850_IBM-280 | IBM-850 to IBM-280 | Italian |
IBM-850_IBM-281 | IBM-850 to IBM-281 | Japanese-Latin |
IBM-850_IBM-284 | IBM-850 to IBM-284 | Spanish |
IBM-850_IBM-285 | IBM-850 to IBM-285 | U.K. English |
IBM-850_IBM-297 | IBM-850 to IBM-297 | French |
IBM-850_IBM-500 | IBM-850 to IBM-500 | Belgian, Swiss German |
IBM-856_IBM-424 | IBM-856 to IBM-424 | Hebrew |
IBM-856_IBM-803 | IBM-856 to IBM-803 | Hebrew |
IBM-856_IBM-862 | IBM-856 to IBM-862 | Hebrew |
IBM-862_IBM-424 | IBM-862 to IBM-424 | Hebrew |
IBM-862_IBM-803 | IBM-862 to IBM-803 | Hebrew |
IBM-862_IBM-856 | IBM-862 to IBM-856 | Hebrew |
IBM-864_IBM-1046 | IBM-864 to IBM-1046 | Arabic |
IBM-921_IBM-1112 | IBM-921 to IBM-1112 | Lithuanian, Latvian |
IBM-922_IBM-1122 | IBM-922 to IBM-1122 | Estonian |
IBM-1112_IBM-921 | IBM-1121 to IBM-921 | Lithuanian, Latvian |
IBM-1122_IBM-922 | IBM-1122 to IBM-922 | Estonian |
IBM-1046_IBM-420 | IBM-1046 to IBM-420 | Arabic |
IBM-1046_IBM-864 | IBM-1046 to IBM-864 | Arabic |
IBM-037_ISO8859-1 | IBM-037 to ISO8859-1 | U.S. English, Portuguese, Canadian French |
IBM-273_ISO8859-1 | IBM-273 to ISO8859-1 | German |
IBM-277_ISO8859-1 | IBM-277 to ISO8859-1 | Danish, Norwegian |
IBM-278_ISO8859-1 | IBM-278 to ISO8859-1 | Finnish, Swedish |
IBM-280_ISO8859-1 | IBM-280 to ISO8859-1 | Italian |
IBM-281_ISO8859-1 | IBM-281 to ISO8859-1 | Japanese-Latin |
IBM-284_ISO8859-1 | IBM-284 to ISO8859-1 | Spanish |
IBM-285_ISO8859-1 | IBM-285 to ISO8859-1 | U.K. English |
IBM-297_ISO8859-1 | IBM-297 to ISO8859-1 | French |
IBM-420_ISO8859-6 | IBM-420 to ISO8859-6 | Arabic |
IBM-424_ISO8859-8 | IBM-424 to ISO8859-8 | Hebrew |
IBM-500_ISO8859-1 | IBM-500 to ISO8859-1 | Belgian, Swiss German |
IBM-803_ISO8859-8 | IBM-803 to ISO8859-8 | Hebrew |
IBM-852_ISO8859-2 | IBM-852 to ISO8859-2 | Croatian, Czechoslovakian, Hungarian, Polish, Romanian, Serbian Latin, Slovak, Slovene |
IBM-855_ISO8859-5 | IBM-855 to ISO8859-5 | Bulgarian, Macedonian, Serbian Cyrillic, Russian |
IBM-866_ISO8859-5 | IBM-866 to ISO8859-5 | Russian |
IBM-869_ISO8859-7 | IBM-869 to ISO8859-7 | Greek |
IBM-875_ISO8859-7 | IBM-875 to ISO8859-7 | Greek |
IBM-870_ISO8859-2 | IBM-870 to ISO8859-2 | Croatian, Czechoslovakian, Hungarian, Polish, Romanian, Serbian, Slovak, Slovene |
IBM-880_ISO8859-5 | IBM-880 to ISO8859-5 | Bulgarian, Macedonian, Serbian Cyrillic, Russian |
IBM-1025_ISO8859-5 | IBM-1025 to ISO8859-5 | Bulgarian, Macedonian, Serbian Cyrillic, Russian |
IBM-857_ISO8859-9 | IBM-857 to ISO8859-9 | Turkish |
IBM-1026_ISO8859-9 | IBM-1026 to ISO8859-9 | Turkish |
IBM-850_ISO8859-1 | IBM-850 to ISO8859-1 | Latin |
IBM-856_ISO8859-8 | IBM-856 to ISO8859-8 | Hebrew |
IBM-862_ISO8859-8 | IBM-862 to ISO8859-8 | Hebrew |
IBM-864_ISO8859-6 | IBM-864 to ISO8859-6 | Arabic |
IBM-1046_ISO8859-6 | IBM-1046 to ISO8859-6 | Arabic |
ISO8859-1_IBM-850 | ISO8859-1 to IBM-850 | Latin |
ISO8859-6_IBM-864 | ISO8859-6 to IBM-864 | Arabic |
ISO8859-6_IBM-1046 | ISO8859-6 to IBM-1046 | Arabic |
ISO8859-8_IBM-856 | ISO8859-8 to IBM-856 | Hebrew |
ISO8859-8_IBM-862 | ISO8859-8 to IBM-862 | Hebrew |
ISO8859-1_IBM-037 | ISO8859-1 to IBM-037 | U.S. English, Portuguese, Canadian French |
ISO8859-1_IBM-273 | ISO8859-1 to IBM-273 | German |
ISO8859-1_IBM-277 | ISO8859-1 to IBM-277 | Danish, Norwegian |
ISO8859-1_IBM-278 | ISO8859-1 to IBM-278 | Finnish, Swedish |
ISO8859-1_IBM-280 | ISO8859-1 to IBM-280 | Italian |
ISO8859-1_IBM-281 | ISO8859-1 to IBM-281 | Japanese-Latin |
ISO8859-1_IBM-284 | ISO8859-1 to IBM-284 | Spanish |
ISO8859-1_IBM-285 | ISO8859-1 to IBM-285 | U.K. English |
ISO8859-1_IBM-297 | ISO8859-1 to IBM-297 | French |
ISO8859-1_IBM-500 | ISO8859-1 to IBM-500 | Belgian, Swiss German |
ISO8859-2_IBM-852 | ISO8859-2 to IBM-852 | Croatian, Czechoslovakian, Hungarian, Polish, Romanian, Serbian Latin, Slovak, Slovene |
ISO8859-2_IBM-870 | ISO8859-2 to IBM-870 | Croatian, Czechoslovakian, Hungarian, Polish, Romanian, Serbian Latin, Slovak, Slovene |
ISO8859-5_IBM-855 | ISO8859-5 to IBM-855 | Bulgarian, Macedonian, Serbian Cyrillic, Russian |
ISO8859-5_IBM-880 | ISO8859-5 to IBM-880 | Bulgarian, Macedonian, Serbian Cyrillic, Russian |
ISO8859-5_IBM-1025 | ISO8859-5 to IBM-1025 | Bulgarian, Macedonian, Serbian Cyrillic, Russian |
ISO8859-6_IBM-420 | ISO8859-6 to IBM-420 | Arabic |
ISO8859-5_IBM-866 | ISO8859-5 to IBM-866 | Russian |
ISO8859-7_IBM-869 | ISO8859-7 to IBM-869 | Greek |
ISO8859-7_IBM-875 | ISO8859-7 to IBM-875 | Greek |
ISO8859-8_IBM-424 | ISO8859-8 to IBM-424 | Hebrew |
ISO8859-8_IBM-803 | ISO8859-8 to IBM-803 | Hebrew |
ISO8859-9_IBM-857 | ISO8859-9 to IBM-857 | Turkish |
ISO8859-9_IBM-1026 | ISO8859-9 to IBM-1026 | Turkish |
Multibyte code-set converters convert characters among the following code-sets:
The following table lists code set names that are compatible. Each line defines to/from strings that may be used when requesting a converter.
Code Set Compatibility | |||
Language | PC | ISO | EBCDIC |
---|---|---|---|
Japanese | IBM-932 | IBM-eucJP | IBM-930, IBM-939 |
Japanese (MS compatible) |
IBM-943 | IBM-eucJP | IBM-930, IBM-939 |
Korean | IBM-934 | IBM-eucKR | IBM-933 |
Traditional Chinese | IBM-938, big-5 | IBM-eucTW | IBM-937 |
Simplified Chinese | IBM-1381 | IBM-eucCN | IBM-935 |
The following list describes the Multibyte Code Set converters that are found in the /usr/lib/nls/loc/iconv directory.
This converter provides conversion between internal code and 7-bit standard interchange formats (fold7). The fold7 name identifies encodings that can be used to pass text data through 7-bit mail protocols. The encodings are based on ISO2022. For more information about fold7 see "Understanding libiconv" .
The fold7 converters convert characters from a code set to a canonical 7-bit encoding that identifies each character. This type of conversion is useful in networks where clients communicate with different code sets but use the same character sets. For example:
IBM-850 <--> ISO8859-1 | Common Latin characters |
IBM-932 <-->IBM-eucJP | Common Japanese characters |
The following escape sequences designate standard code sets:
When converting from a code set to fold7, the escape sequence used to designate the code set is chosen according to the order listed. For example, the JISX0208.1983-0 characters use 01/11 01/04 04/02 as the designation.
The following list describes the fold7 converters that are found in the /usr/lib/nls/loc/iconv directory:
This converter provides conversions between internal code and 8-bit standard interchange formats (fold8). The fold8 name identifies encodings that can be used to pass text data through 8-bit mail protocols. The encodings are based on ISO2022. For more information about fold8 see "Understanding libiconv" .
The fold8 converters convert characters from a specific code set encoding to a canonical 8-bit encoding that identifies each character. This type of conversion is useful in networks where clients communicate with different code sets but use the same character sets. For example:
IBM-850 <--> ISO8859-1 | Common Latin characters |
IBM-932 <-->IBM-eucJP | Common Japanese characters |
The following escape sequences designate standard code sets.
When converting from a code set to fold8, the escape sequence used to designate the code set is chosen according to the order listed. For example, the JISX0208.1983-0 characters use 01/11 02/04 02/08 04/02 as the designation.
The following list describes the fold8 converters found in the /usr/lib/nls/loc/iconv directory:
Compound text interchange converters convert between compound text and internal code sets.
Compound text is an interchange encoding defined by the X Consortium. It is used to communicate text between X clients. Compound text is based on ISO2022 and can encode most character sets using standard escape sequences. It also provides extensions for encoding private character sets. The supported code sets provide a converter to and from compound text. The name used to identify the compound text encoding is ct.
The following escape sequences are used to designate standard code sets in the order listed below.
The following list describes the compound text converters that are found in the /usr/lib/nls/loc/iconv directory:
This converter provides the same mapping as the uuencode and uudecode Command.
During conversion from uucode, 62 bytes at a time (including a new-line character trailing the record) are converted, and generating 45 bytes in outbuf.
The following list describes the uucode converters found in the /usr/lib/nls/loc/iconv directory:
UCS-2 is a universal, 16-bit encoding described in the "Code Set Overview" . Conversions for each code set are provided in both directions, between the code set and UCS-2.
UCS-2 converters are found in /usr/lib/nls/loc/uconvTable and /usr/lib/nls/loc/uconv directories. The uconvdef command is used to generate new converters or to customize existing UCS-2 converters.
The /usr/lib/nls/loc/iconv/Universal_UCS_Conv converter is used to generate conversions from any code set X to code set Y by setting the proper links:
cd /usr/lib/nls/loc/iconv ln -s /usr/lib/nls/loc/uconv/Universal_UCS_Conv X_Y ln -s /usr/lib/nls/loc/uconv/UCSTBL X_UCS-2 ln-s /usr/lib/nls/loc/uconv/UCSTBL UCS-2_Y ln -s /usr/lib/nls/loc/uconv/UCSTBL X ln -s /usr/lib/nls/loc/uconv/UCSTBL Y
UTF-8 is a universal, multibyte encoding described in the "UCS-2 and UTF-8" . Conversions for each code set are provided in both directions, between the code set and UTF-8.
UTF-8 converters are usually done by using the Universal_UCS_Conv (see "List of UCS-2 Interchange Converters" and /usr/lib/nls/loc/uconv/UTF-8 conversion.
Converter | Description |
---|---|
ISO8859-1 | UTF-8 <--> ISO Latin-1 |
ISO8859-2 | UTF-8 <--> ISO Latin-2 |
ISO8859-3 | UTF-8 <--> ISO Latin-3 |
ISO8859-4 | UTF-8 <--> ISO Latin-4 |
ISO8859-5 | UTF-8 <--> ISO Cyrillic |
ISO8859-6 | UTF-8 <--> ISO Arabic |
ISO8859-7 | UTF-8 <--> ISO Greek |
ISO8859-8 | UTF-8 <--> ISO Hebrew |
ISO8859-9 | UTF-8 <--> ISO Turkish |
JISX0201.1976-0 | UTF-8 <--> Japanese JISX0201-0 |
JISX0208.1983-0 | UTF-8 <--> Japanese JISX0208-0 |
CNS11643.1986-1 | UTF-8 <--> Chinese CNS11643-1 |
CNS11643.1986-2 | UTF-8 <--> Chinese CNS11643-2 |
KSC5601.1987-0 | UTF-8 <--> Korean KSC5601-0 |
IBM-eucCN | UTF-8 <--> Simplified Chinese EUC |
IBM-eucJP | UTF-8 <--> Japanese EUC |
IBM-eucKR | UTF-8 <--> Korean EUC |
IBM-eucTW | UTF-8 <--> Traditional Chinese EUC |
IBM-udcJP | UTF-8 <--> Japanese user-defined characters |
IBM-udcTW | UTF-8 <--> Traditional Chinese user-defined characters |
IBM-sbdTW | UTF-8 <--> Traditional Chinese IBM-specific characters |
UCS-2 | UTF-8 <--> UCS-2 |
IBM-437 | UTF-8 <--> USA PC data code |
IBM-850 | UTF-8 <--> Latin-1 PC data code |
IBM-852 | UTF-8 <--> Latin-2 PC data code |
IBM-857 | UTF-8 <--> Turkish PC data code |
IBM-860 | UTF-8 <--> Portuguese PC data code |
IBM-861 | UTF-8 <--> Icelandic PC data code |
IBM-863 | UTF-8 <--> French Canadian PC data code |
IBM-865 | UTF-8 <--> Nordic PC data code |
IBM-869 | UTF-8 <--> Greek PC data code |
IBM-921 | UTF-8 <--> Baltic Multilingual data code |
IBM-922 | UTF-8 <--> Estonian data code |
IBM-932 | UTF-8 <--> Japanese PC data code |
IBM-943 | UTF-8 <--> Japanese PC data code |
IBM-934 | UTF-8 <--> Korea PC data code |
IBM-935 | UTF-8 <--> Simplified Chinese EBCDIC |
IBM-936 | UTF-8 <--> People's Republic of China PC data code |
IBM-938 | UTF-8 <--> Taiwanese PC data code |
IBM-942 | UTF-8 <--> Extended Japanese PC data code |
IBM-944 | UTF-8 <--> Korean PC data code |
IBM-946 | UTF-8 <--> People's Republic of China SAA data code |
IBM-948 | UTF-8 <--> Traditional Chinese PC data code |
IBM-1124 | UTF-8 <--> Ukranian PC data code |
IBM-1129 | UTF-8 <--> Vietnamese PC data code |
TIS-620 | UTF-8 <--> Thailand PC data code |
IBM-037 | UTF-8 <--> USA, Canada EBCDIC |
IBM-273 | UTF-8 <--> Germany, Austria EBCDIC |
IBM-277 | UTF-8 <--> Denmark, Norway EBCDIC |
IBM-278 | UTF-8 <--> Finland, Sweden EBCDIC |
IBM-280 | UTF-8 <--> Italy EBCDIC |
IBM-284 | UTF-8 <--> Spain, Latin America EBCDIC |
IBM-285 | UTF-8 <--> United Kingdom EBCDIC |
IBM-297 | UTF-8 <--> France EBCDIC |
IBM-500 | UTF-8 <--> International EBCDIC |
IBM-875 | UTF-8 <--> Greek EBCDIC |
IBM-930 | UTF-8 <--> Japanese Katakana-Kanji EBCDIC |
IBM-933 | UTF-8 <--> Korean EBCDIC |
IBM-937 | UTF-8 <--> Traditional Chinese EBCDIC |
IBM-939 | UTF-8 <--> Japanese Latin-Kanji EBCDIC |
IBM-1026 | UTF-8 <--> Turkish EBCDIC |
IBM-1112 | UTF-8 <--> Baltic Multilingual EBCDIC |
IBM-1122 | UTF-8 <--> Estonian EBCDIC |
IBM-1124 | UTF-8 <--> Ukranian EBCDIC |
IBM-1129 | UTF-8 <--> Vietnamese EBCDIC |
IBM-1381 | UTF-8 <--> Simplified Chinese PC data code |
GBK | UTF-8<--> Simplified Chinese |
TIS-620 | UTF-8 <--> Thailand EBCDIC |
A set of low level converters used by the code set and interchange converters is provided. These converters are called miscellaneous converters. These low-level converters may be used by some of the interchange converters. However, the use of these converters is discouraged because they are intended for support of other converters.
The following list describes the miscellaneous converters found in the /usr/lib/nls/loc/iconv and /usr/lib/nls/loc/iconvTable directories:
National Language Support Overview for Programming, List of National Language Support Subroutines.
Code Sets Overview in AIX Kernel Extensions and Device Support Programming Concepts.
The iconv command, uuencode and uudecode commands.
The iconv_open subroutine, iconv subroutine, iconv_close subroutine.