Encoding support

z/OS XML System Services supports several code pages. The caller must supply the CCSID of the encoding for the document at the time the z/OS XML parser is initialized. For a complete listing of the supported code pages, see Supported encodings. The following table lists more commonly used code pages with their associated CCSID values, along with the equates provided for the caller.
Table 1. Code page CCSID values
Code page CCSID Equate Names
UTF-8 1208 GXLHXEC_ENC_UTF_8
UTF-16 (big endian) 1200 GXLHXEC_ENC_UTF_16
EBCDIC/IBM-037 37 GXLHXEC_ENC_IBM_037
EBCDIC/IBM-1047 1047 GXLHXEC_ENC_IBM_1047
Assembler callers use equate names without the "GXLH" prefix.

The query service can be used to query a document's XML declaration so that a caller can determine if the document has to first be converted to one of the supported encodings before parsing begins. This function will return a parsed record for the XML declaration that contains, among other things, a Coded Character Set IDentifier (CCSID) which can be passed to an encoding conversion service, such as Unicode Services, to put the document in a form that the z/OS XML parser can process. See the description for gxlpQuery — query an XML document or GXL1QXD (GXL4QXD) — query an XML document for more information.