Unicode from Other ILE Languages

The Unicode functions are easily accessible in the C and C++ languages if you include the appropriate header files and use the appropriate LOCALETYPE option on the C or C++ compilation command. The Unicode functions are accessible from other ILE languages, such as RPG, COBOL, and CL, although no header files are provided for these languages.

The following table shows the functions added for UCS-2 support. The support functions have a prefix of _UCS2_ or _C_UCS2_ added to the standard function name. The Unicode function has the same parameters as the standard (non-Unicode) function.

When you use the LOCALETYPE(*LOCALEUCS2) option with either the C or C++ compiler, the default UCS-2 locale is loaded when the program starts. When you use any of the Unicode functions in the preceding table from a different language, a call to _UCS2_setlocale(LC_ALL, "") should be added when the application starts to ensure that the default UCS2 locale is loaded.

The following table shows the functions added for CCSID neutral and UTF-8 support. The functions have a prefix of _C_NEU_DM_ (for data management I/O functions), _C_NEU_IFS_ or _C_UTF_IFS (for IFS I/O functions), or _C_NEU_ or _C_UTF_ added to the standard function name. The Unicode function has the same parameters as the standard (non-Unicode) function.

Functions that operate on wide characters have UTF in the prefix. Functions that do not operate on wide characters have NEU in the prefix.

When you use the LOCALETYPE(*LOCALEUTF) option with either the C or C++ compiler, the default UTF locale is loaded at program startup time. If you use any of the Unicode functions in the preceding table from a different language, a call to _C_UTF_setlocale(LC_ALL, "") should be added when the application starts to ensure that the default UTF locale is loaded.