The following example illustrates how to create a locale named TEXAN using the charmap file representing the ibm-437 encoded character set. The locale is derived from the locale representing the English language and the cultural conventions of the United States.
For this example, use the locale for the English language in the United States, the source for which is en_us\ibm-437.loc.
For example, create a subdirectory called fred in the VisualAge C++ locale directory and copy locale en_us\ibm-437.loc from the locale directory, \IBMCPPW\LOCALE, with the following command:
copy en_us\ibm-437.loc \IBMCPPW\LOCALE\fred\texan.loc
For our example locale, we modify the representation of date and time information to include the greeting "Howdy Pardner" by changing:
d__fmt "%a %b %e %H:%M:%S %Z %Y"
to read:
d_t_fmt "Howdy Pardner %a %b %e %H:%M:%S %Z %Y"
To create our example TEXAN locale from the command line in the directory containing our load modules, and if VisualAge C++ is installed on drive X, type:
localdef /f X:\IBMCPPW\LOCALE\IBM437.cm /i texan.loc texan.lcl
The customized locale is now ready to be used in application programs by calls to the setlocale function. For example, programs can activate the TEXAN locale with the C or C++ statement:
setlocale(LC_ALL, "texan");
Example: Select a Locale Explicitly by Name
Example: Select a Locale Using Environment Variables
![]()
Make Your Program International
Select a Locale
Supply
DLLs for Locale Handling
![]()
LOCALDEF Utility
Locale Categories
