Managing GLS Files
This appendix provides the following information about how to manage GLS files:
Accessing GLS Files
Informix products access the following GLS files to obtain locale-related information.
In general, you do not need to examine the GLS files. However, you might want to look at these files to determine the following locale-specific information.
GLS Locale Files
The locale file defines a GLS locale. It describes the basic language and cultural conventions that are relevant to the processing of data for a given language and territory. This section provides the following information about GLS locale files:
Locale Categories
A GLS locale file groups locale-specific information into the six locale categories that the following table shows.
The CTYPE and COLLATION categories primarily affect how the database server stores and retrieves character data in a database. The NUMERIC, MONETARY, and TIME categories affect how a client application formats the internal values of the associated SQL data types.
The default locale, U.S. English, provides the following behavior for each of the locale categories.
The following sections describe each of these locale categories in more detail.
The CTYPE Category
The CTYPE category defines how to classify the characters of the code set that the locale supports. This category includes specifications for which characters the locale classifies as spaces, blanks, control characters, digits, uppercase letters, lowercase letters, and punctuation. This category might also include mappings between uppercase and lowercase letters. Informix products access this category when they need to determine the validity of an identifier name, shift the case of a character, or compare characters.
For Version 7.2 and later products, the CTYPE locale category replaces the functionality of the NLS environment variable, LC_CTYPE. 
The COLLATION Category
The COLLATION category defines the localized order. When an Informix product needs to compare two strings, it first breaks up the strings into a series of collation elements. The database server compares each pair of collation elements according to the collation weights of each element. The COLLATION category provides support for the following capabilities:
For example, the localized order might treat the Spanish double-l (ll ) as a single collation element instead of a pair of l 's.
For example, the localized order might specify that a and A are an equivalence class (a and A are equivalent characters).
The difference in collation order is the only distinction between the CHAR and NCHAR data types and the VARCHAR and NVARCHAR data types. For more information, see "Using Character Data Types".
If a locale does not contain a COLLATION category, Informix products use code-set order for collation of all character data types (CHAR, NCHAR, NVARCHAR, TEXT, and VARCHAR).
For Version 7.2 and later products, the COLLATION locale category replaces the functionality of the NLS environment variable, LC_COLLATE. 
The NUMERIC Category
The NUMERIC category defines the following numeric notation for end-user formats of numeric, non-monetary values:
This numeric notation applies to the end-user formats of data for numeric (DECIMAL, INTEGER, SMALLINT, FLOAT, SMALLFLOAT) columns within a client application. For more information on end-user formats, see page 1-12.
The NUMERIC category also defines alternative digits for use in era-based dates and times. For more information on alternative digits, see "Alternative Date Formats" and "Alternative Time Formats".
For Version 7.2 and later products, the NUMERIC locale category replaces the functionality of the NLS environment variable, LC_NUMERIC. 
The MONETARY Category
The MONETARY category defines the following currency notation for end-user formats of monetary values:
This currency notation applies to the end-user formats of data from MONEY columns within a client application. For more information on end-user formats, see page 1-12.
The MONETARY category also defines the default scale for a MONEY column. For the default locale (U.S. English), the database server stores the data type MONEY(precision) in the same internal format as the data type DECIMAL(precision,2). A nondefault locale can define a different default scale. For more information on default scales, see "Default Values for the Scale Parameter".
To customize the end-user format of monetary values, use the DBMONEY environment variable. For more information, see "Customizing Monetary Values".
For Version 7.2 and later products, the MONETARY locale category replaces the functionality of the NLS environment variable, LC_MONETARY. 
The TIME Category
The TIME category lists characters and symbols that format date and time values. This information includes the names and abbreviations for days of the week and months of the year. It also includes special representations for dates, time (12-hour and 24-hour), and DATETIME values.
These representations can include the names of eras (as in the Japanese Imperial era system) and non-Gregorian calendars (such as the Arabic lunar calendar). The locale determines what calendar to use (Gregorian, Hebrew, Arabic, Japanese Imperial, and so on) when it scans or prints a month, day, or year. For more information on the scan and print operations, see "End-User Formats".
If the locale supports era-based dates and times, the TIME category defines the full and abbreviated era names and special date and time representations. For more information, see "Alternative Date Formats" and "Alternative Time Formats".
This date and time information applies to the end-user formats of data in DATE and DATETIME columns within a client application. For example, the ESQL/COBOL library routine ECO-DAT uses the date end-user format in the TIME category of the client locale to determine how to print a date string from an internal DATE value.
To customize the format of date and time values, use the GL_DATE and GL_DATETIME environment variables. For more information, see "Customizing Date and Time End-User Formats".
For Version 7.2 and later products, the TIME locale category replaces the functionality of the NLS environment variable, LC_TIME. 
The MESSAGES Category
The MESSAGES category defines the format for affirmative and negative responses. This category is optional. Informix products do not use the strings that the MESSAGES category defines.
To obtain the locale name for the MESSAGES category of the client locale, a client application uses the locale that CLIENT_LOCALE indicates. If CLIENT_LOCALE is not set, the client sets the category to the default locale.
Location of Locale Files
When an Informix product needs to obtain locale-specific information, it accesses one of the following GLS locale files, depending on the platform:
In these paths, INFORMIXDIR is the environment variable that specifies the directory in which you install the Informix product, and gls is the subdirectory that contains the GLS files.
This section describes the remaining elements in the pathname of GLS locale files, as follows:
The subdirectories of the lcX subdirectory, where X represents the version number for the locale object-file format, contain the GLS locale files. These subdirectories have names of the form lg_tr, where lg is the 2-character language name and tr is the 2-character territory name that the locale supports.
The GLS locale-file subdirectories are in the $INFORMIXDIR/gls/lcX directory. 
The GLS locale-file subdirectories are in the %INFORMIXDIR%\gls\lcX directory. 
The following table shows some languages and territories that Informix products can support, along with their associated locale-file subdirectory names.
Version 7.2 and later products also provide GLS locales that are compatible with many operating-system locales. These locale files reside in the os subdirectory of the lcX subdirectory in your Informix installation. The os subdirectory contains a subdirectory for each operating-system locale that the platform of your Informix product supports.
The GLS operating-system locales are in subdirectories of the $INFORMIXDIR/gls/lcX/os directory. 
The GLS operating-system locales are in subdirectories of the %INFORMIXDIR%\gls\lcX\os directory. 
Informix provides these operating-system GLS locale files for backward compatibility with Informix NLS products. For more information, see the Informix Migration Guide. 
Locale Source and Object Files
Each locale file has the following two forms:
This file has the .lc file extension and serves as documentation for the corresponding object file.
Informix products use the object file to obtain locale information quickly. Locale object files have the .lco file extension.
The header of the locale source file (.lc) lists the language, territory, code set, and any optional locale modifier of the associated locale. A section of the locale source file supports each of the locale categories, as Figure A-1 shows.
Figure A-1
Locale Categories in a Locale Source File
Locale Filenames
To conform to DOS 8.3 naming conventions, a GLS locale file uses a condensed form of the code-set name, codemodf, in its filenames. The 4-character code name of each locale file is the hexadecimal representation of the code-set number for the code set that the locale supports. The 4-character modf name is the optional locale modifier.
For example, the ISO8859-1 code set has an IBM CCSID number of 819 in decimal and 0333 in hexadecimal. Therefore, the 4-character name of a locale source file that supports the ISO8859-1 code set is 0333.lc. The following table shows some code sets and locale modifiers that Informix products can support, along with their associated locale source filenames.
A French locale that supports the ISO8859-1 code set has a GLS locale that is called 0333.lc file in the fr_fr locale-file subdirectory. The default locale, U.S. English, also uses the ISO8859-1 code set (on UNIX platforms); a locale file that is called 0333.lc is also in the en_us locale-file subdirectory. Because both the French and U.S. English locales support the Microsoft 1252 code set, both the fr_fr and en_us locale-file subdirectories contain a 04e4.lc locale file as well.
Figure A-2 shows the output that the glfiles utility generates for locale files. 
Other GLS Files
In addition to GLS locale files, Informix products might also use the following GLS files:
This section describes each of these types of GLS files. For information on GLS locale files, see page A-3.
Code-Set-Conversion Files
The code-set-conversion file describes how to map each character in a particular source code set to the characters of a particular target code set. Informix products can perform a given code-set conversion if code-set-conversion files exist to describe the mapping between the two code sets.
When an Informix product needs to obtain code-set-conversion information, it accesses one of the following GLS code-set-conversion files, depending on the platform:
In these paths, INFORMIXDIR is the environment variable that specifies the directory in which you install the Informix product, gls is the subdirectory that contains the GLS files, and Y represents the version number for the code-set-conversion object-file format.
This section describes the remaining elements in the pathname of GLS code-set-conversion files, as follows:
Each code-set-conversion file has the following two forms:
This file has a .cv extension and serves as documentation for the corresponding object file.
Informix products use the object file to obtain code-set-conversion information quickly. Object code-set-conversion files have a .cvo file extension.
The header of the code-set-conversion source file (.cv) lists the two code sets that it converts, and the direction of the conversion.
Code-Set-Conversion Filenames
To conform to DOS 8.3 naming conventions, GLS code-set-conversion files use a condensed form of the code-set names, code1code2, in their filenames. The 8-character name of each code-set-conversion file is derived from the hexadecimal representation of the code-set numbers of the source code set (code1) and the target code set (code2).
For example, the ISO8859-1 code set has an IBM CCSID number of 819 in decimal and 0333 in hexadecimal. The IBM CCSID 437 code set, a common IBM UNIX code set, has a hexadecimal value of 01b5. Therefore, the 033301b5.cv code-set-conversion file describes the conversion from the CCSID 819 code set to the CCSID 437 code set.
Required for Code-Set Conversion
Informix products use the Informix Code-Set Name-Mapping file to translate between code-set names and the more compact code-set numbers. You can use the registry file to find the hexadecimal values that correspond to code-set names or code-set numbers. For more information, see "The Informix registry File".
Most code-set conversion requires two code-set-conversion files. One file supports conversion of characters in code set A to their counterparts in code set B. Another supports the conversion in the return direction (from B to A). Such conversions are called two-way code-set conversions. For example, the code-set conversion between the CCSID 437 code set (hexadecimal 01b5 code number) and the CCSID 819 (or ISO8859-1 with a hexademical 0333 code number) code set requires the following two code-set-conversion files:
To be able to convert between these two code sets, an Informix product must be able to locate both these code-set-conversion object files. Performing the conversion on only one direction would result in mismatched characters. For more information on mismatched characters, see page 1-42.
The following table shows some of the code-set conversions that Informix products can support, along with their associated code-set-conversion source filenames.
Figure A-4 shows the output that the glfiles utility generates for these code-set-conversion files. 
Code-Set Files
An Informix code-set file (also called a charmap file) defines a code set for subsequent use by locale and code-set-conversion files. A GLS locale includes the appropriate code-set file for the code set it supports. In addition, Informix products can perform code-set conversion between the code sets that have code-set files.
When an Informix product needs to obtain code-set information, it accesses one of the following GLS code-set files, depending on the platform:
In these paths, INFORMIXDIR is the environment variable that specifies the directory in which you install the Informix product, gls is the subdirectory that contains the GLS files, and Z represents the version number for the code-set object-file format.
Each code-set file has the following two forms:
This file has a .cm extension and serves as documentation for the corresponding object file.
The object file is used to create locale object files. Object code-set files have a .cmo file extension.
Figure A-5 shows the output that the glfiles utility generates for code-set files. 
The Informix registry File
The Informix Code-Set Name-Mapping file, which is called registry, is an ASCII file that associates code-set names and aliases with their code-set numbers. A code-set number is based on the IBM CCSID numbering scheme. Informix products use code-set numbers to determine the filenames of locale and code-set-conversion files. For more information on locale files and code-set-conversion files, see page A-12 and page A-16, respectively.
For example, you can specify the French locale that supports the ISO8859-1 code set with any of the following locale names as locale aliases:
When you specify a locale name with either of the first two forms, Informix products use the Informix Code-Set Name-Mapping file to translate between code-set names (8859-1) or code-set number (819) to the condensed code-set name (0333). For information about the file format and search algorithm that Informix products use to convert code-set names to code-set numbers, refer to the comments at the top of the registry file.
When an Informix product needs to obtain information about locale aliases, it accesses one of the following GLS code-set files, depending on the platform:
In these paths, INFORMIXDIR is the environment variable that specifies the directory in which you install the Informix product, gls is the subdirectory that contains the GLS files, and Z represents the version number for the code-set object-file format.
Removing Unused Files
An Informix product contains the following GLS files:
To save disk space, you might want to keep only those files that you intend to use. This section describes which of these files you can safely remove from your Informix installation.
Removing Locale and Code-Set-Conversion Files
You can safely remove the following GLS files from your Informix installation:
Because Informix products do not access source versions of locale and code-set conversion files, you can safely remove them. However, these files do provide useful on-line documentation for the supported locales and code-set conversions. If you have enough disk space, Informix recommends that you keep these source files for the GLS locales (*.lc) and code-set conversions (*.cv) that your Informix installation supports.
Removing Code-Set Files
Informix provides the source version of code-set files (.cm) as on-line documentation for the locales and code-set conversions that use them. Because Informix products do not access source code-set files, you can safely remove them. However, if you have enough disk space, Informix recommends that you keep these source files for the GLS locales and code-set conversions that your Informix installation supports.
The glfiles Utility
To comply with DOS 8.3 naming conventions, Informix products use condensed filenames to store GLS locales and code-set-conversion files. These filenames do not match the names of the locales and code sets that the end user uses. You can use the glfiles utility to generate a more readable list of the following GLS-related files:
Before you run glfiles, take the following steps:
If you do not set INFORMIXDIR, glfiles checks the /usr/informix directory for the GLS files.
The utility creates the GLS file listings in the current directory.
The following diagram shows the syntax of the glfiles utility.
Listing GLS Locale Files
The glfiles utility can create a file that lists the available GLS locales in the following ways:
For each lcX subdirectory in $INFORMIXDIR/gls, glfiles creates a file in the current directory that is called lcX.txt, where X is the version number of the locale object-file format. The lcX.txt file lists the locales in alphabetical order, sorted on the name of the GLS locale object file.
Figure A-2 shows a sample file, lc11.txt, that contains the available GLS locales.
The lcX.txt file also contains GLS locales that are compatible with many operating-system locales. Figure A-3 shows the format in lc11.txt for these GLS operating-system locales. For more information, see "Locale-File Subdirectories".
Examine the lcX.txt file(s) to determine the GLS locales that the $INFORMIXDIR/gls/lcX directory on your system supports.
Listing Code-Set-Conversion Files
When you specify the -cv command-line option, the glfiles utility creates a file that lists the available code-set-conversion files. For each cvY subdirectory in $INFORMIXDIR/gls, glfiles creates a file in your current directory that is called cvY.txt, where Y is the version number of the code-set-conversion object-file format. The cvY.txt file lists the code-set conversions in alphabetical order, sorted on the name of the object code-set-conversion file.
For two-way code-set conversions, the $INFORMIXDIR/gls/cvY directory contains two code-set-conversion files. One file supports conversion from the characters in code set A to their mappings in code set B, and another supports the conversion in the return direction (from code set B to code set A). For more information on two-way code-set conversion, see page A-14.
Figure A-4 shows a sample file, cv9.txt, that contains the available code-set conversions.
Examine the cvY.txt file to determine the code-set conversions that the $INFORMIXDIR/gls/cvY directory on your system supports.
Listing Code-Set Files
When you specify the -cm command-line option, the glfiles utility creates a file that lists the available code-set files. For each cmZ subdirectory in $INFORMIXDIR/gls, glfiles creates a file in the current directory that is called cmZ.txt, where Z is the version number of the code-set object-file format. The cmZ.txt file lists the code sets in alphabetical order, sorted on the name of the GLS object code-set file.
Figure A-5 shows a sample file, cm3.txt, that contains the available code sets.
Examine the cmZ.txt file to determine the code sets that the $INFORMIXDIR/ gls/cmZ directory on your system supports. 
|