ILE C/C++ Programmer's Guide
If an ILE C program is compiled with LOCALETYPE(*LOCALE) and
setlocale() is not called or if it is called with locale name C or
POSIX, the default C environment used is that specified in the POSIX locale
definition source in the QSYSLOCALE library. This locale definition is
slightly different from the default C locale for type *CLD. Another
locale definition source member that is called SAA is provided in the
QSYSLOCALE library for compatibility with the default C locale of type
*CLD.
If you wish to migrate your application from locales of type *CLD to locales
of type *LOCALE, but you want to be compatible with the default C locale of
type *CLD, use the SAA locale definition source member in the QSYSLOCALE
library to create a locale with the CRTLOCALE command. Then use the
name of this locale when you call setlocale() in your
application.
The differences between the SAA and POSIX locale definitions are as
follows:
- For the LC_CTYPE category, the SAA locale has all the EBCDIC control
characters defined in the cntrl class, whereas the POSIX locale
only includes the ASCII control characters. Also, SAA has the cent
character and the broken vertical line as punct characters whereas POSIX does
not include these two characters in its punct characters.
- For the LC_COLLATE category, the default collation sequence for SAA is the
EBCDIC sequence whereas POSIX uses the ASCII sequence. This is
independent of the CCSID mapping of the character set. For the POSIX
locale, the first 128 ASCII characters are defined in the collation sequence,
and the remaining EBCDIC characters are at the end of the collating
sequence. Also, in the SAA locale definition, the lowercase letters
collate before the uppercase letters, whereas in the POSIX locale definition,
the lowercase letters collate after the uppercase letters.
- For the LC_TIME category, the SAA locale specifies the date and time
format (d_t_fmt) as "%Y/%M/%D %X" whereas the POSIX locale uses "%a %b %d %H
%M %S %Y".
[ Top of Page | Previous Page | Next Page | Table of Contents ]
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.