The preferred way to specify the code page for parsing an XML document in an alphanumeric data item is to omit the encoding declaration from the document and to rely on the following encoding specification:
Omitting the encoding declaration makes it possible to transmit an XML document between heterogeneous systems without requiring that you update the encoding declaration to reflect any translation imposed by the transmission process.
For details of supported code pages, see the related references about Understanding the encoding of XML documents and Coded character sets for XML documents.
For XMLPARSE(COMPAT):
Although not recommended, you can specify the encoding information for an XML document in the XML declaration with which most XML documents begin. Note that the XML parser generates an exception if it encounters an XML declaration that does not begin in the first byte of an XML document.
This is an example of an XML declaration that includes an encoding declaration:
<?xml version="1.0" encoding="ibm-1140" ?>
Specify the encoding declaration in either of the following ways:
| Code page | Supported aliases |
|---|---|
| 037 | EBCDIC-CP-US, EBCDIC-CP-CA, EBCDIC-CP-WT, EBCDIC-CP-NL |
| 500 | EBCDIC-CP-BE, EBCDIC-CP-CH |
| 1200 | UTF-16 |
| 1208 | UTF-8 |
related tasks
Coded character sets for XML documents