Joined: 17 Jun 2010
Can anyone please help me with below issue. How can I set encoding format as UTF-8?
XML GENERATE XMLBuffer FROM DataSet COUNT IN NumOfChars
S ""UTF-8"" was found as an "ENCODING" phrase operand, but it was not
a valid encoding. The statement was discarded.
WITH Encoding "UTF-8"
Joined: 06 Jun 2008
Location: East Dubuque, Illinois, USA
|The manual tells you much -- if you read it. For example, in the COBOL Language Reference manual on the XML GENERATE statement:
and from the Programming Guide for the cited reference above:
The ENCODING phrase, if specified, determines the encoding of the generated XML document.
Must be an unsigned integer data item or unsigned integer literal and must represent a valid coded character set identifier (CCSID). Must identify one of the code pages supported for COBOL XML processing as described in The encoding of XML documents (Enterprise COBOL Programming Guide).
If identifier-1 references a data item of category national, codepage must specify 1200, the CCSID for Unicode UTF-16.
If identifier-1 references a data item of category alphanumeric, codepage must specify 1208 or the CCSID of a supported EBCDIC code page as listed in The encoding of XML documents (Enterprise COBOL Programming Guide).
If codepage is an identifier, it must not overlap identifier-1 or identifier-3.
In other words, the encoding is an integer, not a text literal as you put it.
| Table 71. Coded character sets for XML documents
Latin 1 / Open Systems
USA, Canada, . . . Euro Country Extended Code Page (ECECP), Country Extended Code Page (CECP)
Austria, Germany ECECP, CECP
Denmark, Norway ECECP, CECP
Finland, Sweden ECECP, CECP
Italy ECECP, CECP
Spain, Latin America (Spanish) ECECP, CECP
UK ECECP, CECP
France ECECP, CECP
International ECECP, CECP
Iceland ECECP, CECP
| 1. Supported for the XML PARSE statement in the ENCODING phrase if | XMLPARSE(XMLSS) is in effect