Suppose the following is the xml document then hello tag is not reading by the poco sax parser because of encoding is ANSI.

<?xml version="1.0" encoding="ANSI"?>
<hello xmlns="  ">

If the encoding is UTF-8 then hello tag is reading and everything is went fine.

Is there any solution in POCO for this issue?

2

There are 2 answers

1
CoffeDeveloper On

The encoding problem arise if you specify a encoding but you use a different encoding, source of trouble could arise (in example) if you copy-paste a XML source between multiple documents, from webpages, or simply because it has a buggy encoder. Try to use some program that can detect encoding and change that, set it to UTF8 and then replace the header tag for ANSI wich the one for UTF8.

0
MSalters On

It's not a POCO problem, fix the producer. There's no such thing as "ANSI" encoding in XML. The producer should generate output in a valid encoding. Whether that's "UTF-8" or "ISO-8859-1" doesn't really matter, as long as it's all consistent.