IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

UTF-8 not valid encoding format in XML GENERATOR


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
naveenkumars

New User


Joined: 17 Jun 2010
Posts: 3
Location: India

PostPosted: Thu Mar 01, 2012 8:42 pm
Reply with quote

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.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Mar 01, 2012 11:02 pm
Reply with quote

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.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts InfoSphere OPTIM CSV ouput vs DSNTIUA... IBM Tools 3
No new posts Need mmmyy date format SYNCSORT 6
Search our Forums:

Back to Top