naveenkumars
New User
Joined: 17 Jun 2010 Posts: 3 Location: India
|
|
|
|
Hi,
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"
WITH XML-Declaration
WITH ATTRIBUTES. |
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
The manual tells you much -- if you read it. For example, in the COBOL Language Reference manual on the XML GENERATE statement:
Quote: |
ENCODING phrase
The ENCODING phrase, if specified, determines the encoding of the generated XML document.
codepage
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.
|
and from the Programming Guide for the cited reference above:
Quote: |
Table 71. Coded character sets for XML documents
CCSID
Description
1208
UTF-8(1)
1047
Latin 1 / Open Systems
1140, 37
USA, Canada, . . . Euro Country Extended Code Page (ECECP), Country Extended Code Page (CECP)
1141, 273
Austria, Germany ECECP, CECP
1142, 277
Denmark, Norway ECECP, CECP
1143, 278
Finland, Sweden ECECP, CECP
1144, 280
Italy ECECP, CECP
1145, 284
Spain, Latin America (Spanish) ECECP, CECP
1146, 285
UK ECECP, CECP
1147, 297
France ECECP, CECP
1148, 500
International ECECP, CECP
1149, 871
Iceland ECECP, CECP
| 1. Supported for the XML PARSE statement in the ENCODING phrase if | XMLPARSE(XMLSS) is in effect
|
In other words, the encoding is an integer, not a text literal as you put it. |
|