Code conversion functions
The iconv_open(), iconv(),
and iconv_close() library functions can be called from C or C++ source
to initialize and perform the characters conversions from one character
set encoding to another.
The iconv() family of functions has been modified to utilize character conversion services
provided by Unicode Services. The iconv_open(), iconv(), and iconv_close() function interfaces
remain unchanged except for the addition of the following:
- Four new errno values - ECUNNOENV, ECUNNOCONV, ECUNNOTALIGNED, and ECUNERR
- Two new environment variables - _ICONV_MODE and _ICONV_TECHNIQUE
There are differences in externals between the iconv() family of functions and Unicode Services.
However, the differences in externals are managed by the iconv() family of functions except where
noted in the C/C++ Migration Guide for Application Developers. All conversions listed in Table 2 and Table 1 will
continue to work as they do today. However, Unicode Services supports conversions between thousands
of additional character sets not listed in Table 2 and
Table 1. A complete list of conversions supported by Unicode Services
can be found in the z/OS Unicode Services User's Guide and Reference. To set up a conversion using iconv_open() for any of the character sets listed
in EBCDIC Conversion Table, ASCII Conversion Table, and Unicode Conversion Table, use a character
string representing the CCSID’s for fromcode/tocode. For example, to set up a conversion from CCSID
00256 to CCSID 00870 using conversion technique R, you need to set the _ICONV_TECHNIQUE environment
variable to R and call iconv_open() as follows:
cd = iconv_open(“00870”, “00256”); and continue to use iconv() and
iconv_close() as in previous releases.