uconvdef Command

Purpose

Compiles or generates a UCS-2 (Unicode) conversion table for use by the iconv library.

Syntax

uconvdef [ -f SrcFile ] [ -v ] UconvTable

Description

The uconvdef command reads SrcFile and creates a compiled conversion table in UconvTable. The SrcFile defines a mapping between UCS-2 and multibyte code sets (one or more bytes per character). The UconvTable is in a format that can be loaded by the UCSTBL conversion method located in the /usr/lib/nls/loc/uconv directory. This method uses the table to support UCS-2 conversions in both directions.

Flags

Item Description
-f SrcFile Specifies the conversion table source file. If this flag is not used, standard input is read.
-v Causes output of the processed file statements.
UconvTable Specifies the path name of the compiled table created by the uconvdef command. This should be the name of the code set that defines conversions into and out of UCS-2.

Exit Status

The following exit values are returned:

Item Description
0 Successful completion.
>0 An error occurred.

Examples

To access the compiled UCS-2 conversion table:

  1. Create the compiled UconvTable using the name of the multibyte code set. For example, the conversion table between IBM-850 and UCS-2 can be compiled as follows:
    uconvdef -f IBM-850.ucmap IBM-850
  2. Place the table in a directory called uconvTable. The default system directory is /usr/lib/nls/loc/uconvTable. If another directory is used, the LOCPATH environment variable needs to be set to include the parent directory (for example, /usr/lib/nls/loc).
    mv IBM-850 /usr/lib/nls/loc/uconvTable
  3. Create symbolic links for conversions in each direction in a directory called iconv. The names for these links should be formed by concatenating the "From" code set and the "To" code set, separated by an underscore. The links should be set to point to the /usr/lib/nls/loc/uconv/UCSTBL conversion method. The default directory for these links is /usr/lib/nls/loc/iconv. If another directory is used, the LOCPATH environment variable needs to be set to include the parent directory (for example, /usr/lib/nls/loc).
    ln -s /usr/lib/nls/loc/uconv/UCSTBL \
    /usr/lib/nls/loc/iconv/IBM-850_UCS-2
    ln -s /usr/lib/nls/loc/uconv/UCSTBL \
    /usr/lib/nls/loc/iconv/UCS-2_IBM-850
    Note: The \ (backslash) is a line continuation character that is only needed if the command is broken into two lines.