HP OpenVMS Systems Documentation |
Compaq C Run-Time Library Utilities Reference Manual
ICONV COMPILE
Creates a conversion table file from a conversion source file. The conversion table file is used by the ICONV CONVERT command to convert characters in a file from one codeset to another. FormatICONV COMPILE sourcefile tablefile Parameters
Qualifiers
DescriptionThe ICONV commands support any 1- to 4-byte codesets that are state independent. They do not support state-dependent codesets. errorsIf an error is encountered during processing, ICONV COMPILE does not generate an output tablefile. If a warning is encountered, a valid table file is created. However, because a warning can indicate a user error, always check the returned warning messages.
|
#1 |
---|
$ ICONV COMPILE /LISTING EUCTW_DECHANYU.ISRC EUCTW_DECHANYU.ICONV |
This example shows how to create a conversion table file to convert the EUCTW codeset to the DECHANYU codeset. The listing file, EUCTW_DECHANYU.LIS, contains a listing of the source file and any error messages generated by the compiler.
Converts characters in a file from one codeset to another codeset. The converted characters are written to an output file.
ICONV CONVERT infile outfile
infile
Required.Name of the file that contains the characters to be converted. The /FROMCODE qualifier specifies the codeset of the characters in this file.
outfile
Required.Name of the file created by ICONV CONVERT. The /TOCODE qualifier specifies the codeset of the characters in this file.
/FROMCODE=fromcodeset
Required.Specifies the codeset of the characters in infile.
/TOCODE=tocodeset
Required.Specifies the codeset of the characters in outfile.
The ICONV CONVERT command converts the characters in infile from the codeset identified by the /FROMCODE qualifier to the codeset identified by the /TOCODE qualifier. The converted file is written to outfile.The conversion is done in one of two ways:
- Using a conversion table file to look up the converted characters. This is the default method. Conversion table files are created by the DCL command ICONV COMPILE.
- Using a shareable image file that implements the required conversion. This method can be used whenever the implementation of a converter by table is either not convenient, for example, huge virtual address space versus small space by algorithm, or not possible, for example, for state dependent encoding like ISO2022.
The converter's file naming convention, valid for both table or image file type of implementations, is:
fromcodeset_tocodeset.iconv
Note
If you add conversion files to your system, they must use the same file-naming convention.ICONV CONVERT searches your current directory for a converter file. If it cannot find the file, it then searches the system directory defined by the logical name SYS$I18N_ICONV.
#1 |
---|
$ ICONV CONVERT /FROMCODE=EUCTW /TOCODE=DECHANYU - _$ FROMFILE.DAT TOFILE.DAT |
This example shows a conversion from EUCTW characters to DECHANYU characters. The EUCTW characters in the file FROMFILE.DAT are converted to the corresponding DECHANYU characters. The converted characters are stored in the file TOFILE.DAT.
Converts a locale source file into a binary locale file. The binary locale file is used by those utilities and C routines that are dependent on the setting of the international environment logical names.
LOCALE COMPILE sourcefile
sourcefile
Required.Name of the locale source file, which defines each category of the locale. The default file type for the source file is .LSRC. For the definition of the locale source file format, see Chapter 2.
/CHARACTER_DEFINITIONS=filename
/NOCHARACTER_DEFINITIONS
Optional. Default: /NOCHARACTER_DEFINITIONSSpecifies a character-set description file (charmap) for the locale. This file maps characters to their actual character encodings.
If a charmap is not specified, no symbolic names (other than collating symbols defined in a collating symbol keyword) are allowed in the locale source file.
For a definition of the charmap file format, see Chapter 3. The default file type for a charmap is .CMAP.
/DISPLAY[=[NO]HOLE]
Optional. Default: /DISPLAY=NOHOLEUsed with certain Chinese locales and terminals to specify that 4-byte characters occupy four printing positions (columns) on the terminal display. The default value (/DISPLAY=NOHOLE) specifies that 4-byte characters occupy two printing positions.
/IGNORE=WARNINGS
/NOIGNORE
Optional. Default: /NOIGNOREGenerates an output file even if LOCALE COMPILE issues warning messages. Use the /IGNORE keyword cautiously because the warnings could indicate user errors that you might want to correct before using the resulting locale file.
/LISTING[=filename]
/NOLISTING
Optional. Batch default: /LISTING; interactive default: /NOLISTINGName of the listing file. The /SHOW qualifier controls the information included in the listing file. If the file name is omitted, the default is sourcefile.LIS.
/OUTPUT=[filename]
/NOOUTPUT
Optional. Default: /OUTPUT=sourcefile.LOCALEName of the output file. Public locales are stored in the directory defined by the logical name SYS$I18N_LOCALE. If the output file is in any other location, the locale is private.
/NOOUTPUT results in no output file creation, even if the compilation succeeds.
/SHOW[=(keyword[,...])]
Optional. Default: /SHOW=(SOURCE,TERMINAL)/SHOW, together with /LISTING, controls the information included in the listing file. You can specify the following keywords:
Keyword Description ALL Include all information. BRIEF Include a summary of the symbol table. [NO]CHARACTER_DEFINITIONS Include or omit the charmap file. NONE Do not print any information. The listing file contains only the generated error messages. [NO]SOURCE Include or omit a listing of the source file. [NO]STATISTICS Include or omit compiler performance information. [NO]SYMBOLS Include or omit a listing of the charmap symbol table. [NO]TERMINAL Display compiler messages at the terminal.
Use the LOCALE COMPILE command to add new locales to your system in addition to those supplied by Compaq. To compile a locale, LOCALE COMPILE requires two files:
- A charmap file that defines the character set for the locale. If you do not specify a charmap file, symbolic names cannot be specified in the locale source file. If this happens, LOCALE COMPILE issues an error or warning message, depending on the category processed, and no output file is produced. (Also see the /IGNORE qualifier.)
- A locale source file. This file describes one or more of the locale categories: LC_CTYPE, LC_COLLATE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, and LC_TIME.
The following error messages are related to the LOCALE COMPILE command:
- %LOCALE-E-CASEALRDY, case conversion already exists for 'character'
Where character is a character from the codeset. This error can occur when the locale compiler is processing the LC_CTYPE category. It indicates that more than one case conversion is specified for character.
- %LOCALE-E-PREOFCMAP, premature end of file in charmap file
Occurs if there is no END CHARMAP statement in the charmap file.- %LOCALE-E-PREEOFSRC, premature end of file in source file
Occurs if there is an error with the END statements in the locale source file.- %LOCALE-F-NOADDSYM, failed to add symbol to symbol table
Occurs when there is insufficient memory to finish the compilation. Check the amount of memory available to your process.- %LOCALE-F-NOINITSYM, failed to initialize symbol table
Occurs if memory is insufficient to finish the compilation. Check the amount of memory available to your process.
#1 |
---|
$ LOCALE COMPILE EN_GB_ISO8859-1 /CHARACTER_DEFINITIONS=ISO8859-1 - _$ /LIST /SHOW=(CHARACTER_DEFINITIONS,SYMBOLS,STATISTICS) |
This example shows how to generate a locale file named EN_GB_ISO8859-1.LOCALE from the source file EN_GB_ISO8859-1.LSRC, using the charmap file ISO8859-1.CMAP. To use this locale file, copy it to the SYS$I18N_LOCALE directory and set the LANG logical to "EN_GB.ISO8859-1". The listing file contains a listing of the charmap file, the symbol table, performance information, and any error messages generated by the compiler.
Loads the specified locale name into the system's memory as shared, read-only global data.
LOCALE LOAD locale_identifier
locale_identifier
Required.Character string that identifies the locale to be loaded. Specify one of the following:
- Name of the public locale
Specifies the public locale. Use the format:
language_country.codeset[@modifier]
LOCALE LOAD searches for the public locale binary file in the location defined by the logical name SYS$I18N_LOCALE. The file type defaults to .LOCALE. The period (.) and at-sign (@) characters in the name specified are replaced by underscore (_) characters.
For example, if the name specified is "zh_CN.dechanzi@radical", LOCALE LOAD searches for the following binary locale file:
SYS$I18N_LOCALE:ZH_CN_DECHANZI_RADICAL.LOCALE- Name of a file
Specifies the binary locale file. This can be any valid file specification. If either the device or directory is not specified, LOCALE LOAD first applies the current caller's device and directory as defaults. If the file is not found, the device and directory defined by the SYS$I18N_LOCALE logical name are used as defaults. The file type defaults to .LOCALE.
Wildcards are not valid. The binary locale file cannot reside on a remote node.
None.
The LOCALE LOAD command loads the specified locale name into the system's memory as several shared, read-only, global sections. All processes that access the loaded locale then use this one copy of the locale, thereby reducing overall demand on system memory.This DCL command is privileged, typically issued by the system manager. The following privileges are required:
- SYSGBL
- PRMGBL
#1 |
---|
$ LOCALE LOAD JA_JP_DECKANJI |
This example shows how to load the JA_JP_DECKANJI locale.
Previous | Next | Contents | Index |