Locale Build Process

Cultural information is encoded in locale source files using the locale definition language. One locale source file characterizes one cultural environment.

VisualAge C++ provides a number of locales that have been defined for most common cultural environments. You can code your program to select, or make active, any defined locale and change locale as required. By default, programs developed with VisualAge C++ run in the POSIX locale.

If you are programming for an environment that is similar but not identical to an existing locale, you can create a new locale by customizing one of the provided locales. This is the best approach if you only need to change a few parameters, such as the time zone, the symbol for the monetary unit, or which characters are used for punctuation. You can also build a locale from scratch.

To customize a locale or build a new one you must provide locale source files and use the locale compilation tool, the LOCALDEF utility to create the locale. The LOCALDEF utility is equivalent to the localedef feature of POSIX, but has been called LOCALDEF to conform to the 8.3 naming convention of FAT file systems.

To enhance portability of the locale source files, certain information related to the character sets can be encoded using the symbolic names of characters. The mapping between the symbolic names and the characters they represent and its associated hexadecimal value is defined in the character set description file, or charmap file.

The conceptual model of the locale build process is presented below:

 cultural      +---------------+           +---------+    coded
 environment   | locale source |           | charmap |    character set
 definition    +-------+-------+           +----+----+    definition
                       |                        |
                       |                        |
                       +------------+-----------+
                                    |
                                    |
                            +----------------+
                            |  LOCALDEF tool |
                            +-------+--------+
                                    |
                                    |
                            +-----------------+          compiled object
                            | Compiled locale | <------> used by locale-
                            +-----------------+          sensitive interfaces 

 

A program can load the locale object created by this process by calling the setlocale function. The locale is then accessed by the VisualAge C++ functions that are sensitive to the cultural information, or that can query the locales.

The ANSI C++ localization library also supports locale objects.



Internationalization
Localization and Locales


Make your Program International
Customize a Locale
Build a Locale


Locale Categories