I'm trying to write a fairly simple XML processor, and Expat seemed like
a lightweight, cross-platform parser to base this on. However, I'm
running into a problem with my UTF-16 encoded XML file, at least on
Specifically, when I use the outline.c sample program, I get the kind of
output I would expect. For example, my XSL-FO file gives me lines like:
However, if I modify this example to read from a file, instead of from
stdin, then same file contents gives me:
I'm assuming the wide characters are causing Expat to treat each
charcter as a null-terminated string. I can't seem to find a way to
overcome this, though. I'm guessing the stdin case works because the
input is somehow filtered into char intead of wchar types.
Is there a way around this? Is there some working sample code that can
read UTF-16 encoded XML from a file?
The Tech Curmudgeon - http://www.techcurmudgeon.com
Ideas Great and Dumb - http://www.ideasgreatanddumb.com