A CCSID is associated with each category of the locale (see setlocale() — Set Locale for a list of locale categories). The most commonly used CCSID from the locale is the CCSID associated with the LC_CTYPE category of the locale. Confusion might arise if different locale categories have different CCSID values, so it is recommended that all locale categories have the same CCSID value. You can retrieve the CCSID of the LC_CTYPE category of the current locale by using the nl_langinfo() function and specifying CODESET as the nl_item. Here are some additional locale CCSID details, broken down by LOCALETYPE option specified on the compilation command:
LOCALETYPE(*CLD) is only supported by the ILE C compiler. Many POSIX functions are not supported when LOCALETYPE(*CLD) is specified. One benefit of the LOCALETYPE(*CLD) option is that all *CLD locales are CCSID 37. A limited number of locale objects are shipped with the system that can be used with LOCALETYPE(*CLD). These objects all have the object type *CLD. To get a list of *CLD locale objects, use the following command:
For more information about *CLD locales, see IBM Rational Development Studio for i: ILE C/C++ Compiler Reference.
This is the default LOCALETYPE setting for the ILE C compiler and ILE C++ compiler. The default locale value usually has a CCSID that is equal to the job CCSID. A wide variety of locale objects exists for this setting. These locale objects have the *LOCALE object type. The LOCALETYPE(*LOCALE) option supports a larger number of CCSIDs and a larger number of functions than the LOCALETYPE(*CLD) option.
This setting introduces a new set of locale categories for UCS-2 characters. These locale category names begin with the LC_UNI_ substring. The original locale categories are still present, and all the preceding notes for LOCALETYPE(*LOCALE) apply to LOCALETYPE(*LOCALEUCS2). This setting causes wide characters to be interpreted as UCS-2 characters instead of wide EBCDIC characters. For more information, see Unicode Support.
The CCSID of the non-wide locale categories is UTF-8 (CCSID 1208) by default, but it can be changed to have any single-byte or multibyte CCSID. The CCSID of the wide character (LC_UNI_*) locale categories is UTF-32. This setting includes limited CCSID neutrality. LOCALETYPE(*LOCALEUTF) uses locale objects of type *LOCALE. For more information, see Unicode Support.