UTF-16 parse fails with "Unclosed token" at line 1 offset 1

[email protected]
Newsgroups gmane.text.xml.expat.general
Message-ID <[email protected]>
I'm having trouble parsing an XML document encoded UTF-16. I create the parser
with XML_ParserCreate(NULL) and I parse the document as follows:

// std::string buffer contains the UTF-16 document
if (XML_Parse(p, buffer.c_str(), buffer.size(), true) == XML_STATUS_ERROR)
  return false;

The error reported is "Unclosed token" at line 1 offset 1. Parsing works fine
with UTF-8 documents. I created and checked the document with XMLSpy, so I can't
imagine there really is an unclosed token (I tried both little- and big-endian
UTF-16). What am I doing wrong?

I'd be very grateful for all help,
Gerald


----------------------------------------------
This mail sent through http://www.ukonline.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.