Software Internationalization Guide
POSIX and XPG Internationalization Model
Software Internationalization Guide—526225-002
3-3
Accessing Locale Objects
for example, collation procedures and date and time formats. Locale-specific
information is isolated from a program’s source code and stored in separate locale
source files.
Isolating locale-specific information in separate locale source files simplifies localizing
a program. When an internationalized program needs to support a new locale, only the
locale source file is localized. It is not necessary to modify or recompile the program’s
source code for every new locale.
Accessing Locale Objects
A program must be properly initialized before functions that support international
behavior can access locale-specific information. The setlocale() function links a
program with appropriate locale data. For details about setlocale(), see the
setlocale(3) reference page either online or in the Open System Services Library
Calls Reference Manual.
Locale Names
XPG defines a locale name as a language, territory, and code set combination that is
specified by language and territory codes.
The format for a locale name is:
Language[_Territory][.Codeset][@modifier]
•
Language specifies a lowercase abbreviation for a language name from ISO 639;
for example, en for English and ja for Japan.
•
Territory specifies an uppercase territory abbreviation from ISO 3166; for
example, US for the United States and JP for Japan.
•
Codeset specifies the name of a code set or encoding method; for example,
Shift-JIS.
•
@modifier selects a specific instance of localization data within a single category;
@modifier is not supported in the HP internationalization subsystem.
The HP internationalization subsystem uses full locale names, fully specifying
language, territory, and code set—for example, ja_JP.SJIS. See Section 4, The HP
Internationalization Subsystem, for more information.
Locale Environment Variables
The POSIX and XPG standards define the set of locale environment variables
available in the OSS environment. These variables are a subset of a system’s
environment variables.
The locale name assigned to the locale environment variables enables an application
to establish the characteristics of a user’s environment after setlocale() is called.
For example, assigning the German locale name to the LC_TIME locale variable