[Expat-discuss] UTF-16 parse fails with "Unclosed token" at line 1 offset 1

gnschmidt at ukonline.co.uk gnschmidt at ukonline.co.uk
Thu Jan 5 14:26:11 CET 2006


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


More information about the Expat-discuss mailing list