informix
Informix Guide to GLS Functionality
Managing GLS Files

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 describes the locale categories and the locations of the locale files.

Locale Categories

A locale file specifies behaviors for the locale categories. 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. For more information about end-user formats, see End-User Formats and Customizing End-User Formats. The following table describes the locale categories and the behaviors for the default locale, U.S. English.

Locale Category Description In Default Locale (U.S. English)
CTYPE Controls the behavior of character classification and case conversion. The default code set classifies characters. On UNIX, the default code set is ISO8859-1. On Windows NT, the default code set is Windows Code Page 1252.
COLLATION Controls the behavior of string comparisons. The default locale does not define a localized order. Therefore, the database server collates NCHAR and NVARCHAR data in code-set order.
NUMERIC Controls the behavior of non-monetary numeric end-user formats. The following numeric notation for use in numeric end-user formats:
  • Thousands separator: comma (,)
  • Decimal separator: period (.)
  • Number of digits between thousands separators: 3
  • Symbol for positive number: plus (+)
  • Symbol for negative number: minus (-)
  • No alternative digits for era-based dates
  • MONETARY Controls the behavior of currency end-user formats. The following currency notation for use in monetary end-user formats:
  • Currency symbol: dollar sign ($) appears before the currency value
  • Thousands separator: comma (,)
  • Decimal separator: period (.)
  • Number of digits between thousands separators: 3
  • Symbol for positive number: plus (+)
  • Symbol for negative number: minus (-) Default scale for MONEY columns: 2
  • TIME Controls the behavior of date and time end-user formats. The following date and time end-user formats:
  • DATE values: %m/%d/%iy
  • DATETIME values: %iY-%m-%d %H:%M:%S No definitions for era-based dates.
  • MESSAGES Controls the definitions of affirmative and negative responses to messages. None

    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.

    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:

    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:

    The NUMERIC Category

    The NUMERIC category defines the following numeric notation for end-user formats of numeric, nonmonetary values:

    This numeric notation applies to the end-user formats of data for numeric (DECIMAL, INTEGER, SMALLINT, FLOAT, SMALLFLOAT) columns within a client application.

    Important: Information in the NUMERIC category does not affect the internal format of the numeric data types in the database.

    The NUMERIC category also defines alternative digits for use in era-based dates and times. For information about alternative digits, see Alternative Date Formats and Alternative Time Formats.

    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.

    Important: Information in the MONETARY category does not affect the internal format of the MONEY data type in the database.

    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 Specifying Values for the Scale Parameter.

    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 reads or prints a month, day, or year.

    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.

    Important: Information in the TIME category does not affect the internal format of the DATE and DATETIME data types in the database.

    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 GLS locale files in the following table.

    Platform Locale File
    UNIX $INFORMIXDIR/gls/lcX/lg_tr/codemodf.lco
    Windows NT %INFORMIXDIR%\gls\lcX\lg_tr\codemodf.lco

    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 rest of this section describes the remaining elements in the pathname of GLS locale files.

    Locale-File Subdirectories

    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 following table shows some languages and territories that Informix products can support, along with their associated locale-file subdirectory names.

    Language Territory Locale-File Subdirectory
    English United States
    Great Britain
    Australia
    en_us
    en_gb
    en_au
    German Germany
    Austria
    Switzerland
    de_de
    de_at
    de_ch
    French Belgium
    Canada
    Switzerland
    France
    fr_be
    fr_ca
    fr_ch
    fr_fr

    Locale Source and Object Files

    Each locale file has the following two forms:

    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 the following table shows.

    Locale Category Locale-File Category Reference
    CTYPE CTYPE page A-5
    COLLATION COLLATION page A-6
    NUMERIC NUMERIC page A-7
    MONETARY MONETARY page A-7
    TIME TIME page A-8
    MESSAGES MESSAGES page A-8

    Locale Filenames

    To conform to the 8.3 filename.ext restriction on the maximum number of characters in valid filenames and file extensions on DOS systems, 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.

    Code Set Locale Modifier Locale Source File
    ISO8859-1 (IBM CCSID 819) None Dictionary 0333.lc 0333dict.lc
    Windows Code Page 1252 (West Europe) None Dictionary 04e4.lc 04e4dict.lc
    IBM CCSID 850 None Dictionary 0352.lc 0352dict.lc

    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 Windows Code Page 1252, both the fr_fr and en_us locale-file subdirectories contain a 04e4.lc locale file as well.


    Informix Guide to GLS Functionality, Version 9.2
    Copyright © 1999, Informix Software, Inc. All rights reserved