tpf_csname_to_ccsid: Convert character set name to coded character set identifier
This function converts a specified character set name (CSNAME), for example utf-8, to the corresponding coded character set identifier (CCSID).
Last updated
Added for PUT06.
Format
#include <tpf/c_icnv.h>
short int tpf_csname_to_ccsid (char *csname)
- csname
- A NULL-terminated string that represents the name of the character set to be converted.
Normal return
A short int representing
the CCSID.
Error return
0
Programming considerations
- The tpf_csname_to_ccsid function looks up the character set name in the CCSID table that is located in the base/rt/civ2.c source file.
- The tpf_csname_to_ccsid function tries to find an exact match for the specified CSNAME in the CCSID table. However, if an exact match is not found, this function converts the specified CSNAME to all uppercase letters and searches the CCSID table again. If a match is not found, 0 is returned. For example, if the CCSID table contains an entry with a CSNAME of UTF8 and you specify a value of utf8 for the csname parameter, searching the table does not find a match. The parameter value is then converted to uppercase letters and the CCSID table is searched a second time; this time, the UTF8 entry is found.
Examples
The following example converts
a character set name to the corresponding CCSID.
#include <tpf/c_icnv.h>
short int myCCSID;
myCCSID = tpf_csname_to_ccsid ("ISO-8859-1");
Related information
See z/TPF Application Programming for more information about adding CSNAMEs and CCSIDs to the CCSID table.
See z/TPF C functions overview for more information about z/TPF C/C++ language support.