We are facing an issue where in the xml messages with the special characters like [· (0xB7), Ý (0xDD), ¨(0xA8)] are getting rejected, when they are actually XML valid characters. What we found is that are invalid characters for the default encoding that is assigned to a message, when not specified. We can avoid this, if we specifically add the encoding type to the top of the message. We used the UTF-8 encoding. So by adding "" to the very beginning of the XML message, the characters should then become valid characters. Below is the cobol code:
XML GENERATE RESPONSEDATA FROM ACCT
COUNT IN RESPONSEDATALL
WITH ENCODING 1208
WITH XML-DECLARATION
END-XML
But when we see the xml generated it consists of characters as shown below:
..Ì_%.ÎÁÊËÑ?>.......Á>Ä?ÀÑ>Å..UTF-8....
The expected output is that the below encoding bit should be added to the header.
<?xml version=“1.0” encoding=“utf-8”?>
So the issue is when this generated XML is parsed back again in another peice of code, it encouters an XML-EXCEPTION and backs out altogether with an exception message.
The question is is there some other peice of code or compile options which need to be added to make this xml valid?