Locale Category Source Definitions

In locale source files, each locale category source definition consists of a block of lines. These lines contain the following sections, in order:

  1. category header
  2. category body
  3. category trailer

category header
The category header consists of the keyword naming the category. Each category name starts with the characters LC_. VisualAge C++ supports the following category names:

  • LC_CTYPE
  • LC_COLLATE
  • LC_MONETARY
  • LC_NUMERIC
  • LC_TIME
  • LC_MESSAGES
  • LC_TOD
  • LC_SYNTAX
  • The LC_TOD and LC_SYNTAX categories, if present, must be the last two categories in the locale definition file.

    category body
    The body of a category definition consists of one or more lines describing the components of the category. Each component line has the following format:

    <identifier> <operand1>
    <identifier> <operand1>;<operand2>;...;<operandN>

    <identifier> is a keyword that identifies a locale element, or a symbolic name that identifies a collating element. <operand> is a character, collating element, or string literal. Escape sequences can be specified in a string literal using the <escape_character>. If multiple operands are specified, they must be separated by semicolons. White space can be before and after the semicolons.

    category trailer
    The category trailer consists of the keyword END followed by one or more <blank>s and the category name of the corresponding category header.

    Example
    Here is an example of locale source containing the header, body, and trailer:

       # Here is a simple locale definition file consisting of one
       # category source definition, LC_CTYPE.
    
       LC_CTYPE
       upper <A>;...;<Z>
       END LC_CTYPE 

    The copy keyword
    In each category the keyword copy followed by a string specifies the name of an existing locale to be used as the source for the definition of this category. The compiler searches for a specified existing locale as follows:

    1. If you specify a path, the compiler searches that path.
    2. If you specify a file name but no path, the compiler searches the current directory.
    3. If you specify a file name but no path and the file is not in the current directory, the compiler searches the paths that you specified in the DPATH environment variable.

    If the locale is not found, an error is reported and no locale output is created.



    Internationalization
    Localization and Locales


    Customize a Locale


    Locale Categories