Co Co Net wrote:
I made an XML document "by hand" and wrote it to a file.
I then tried to read it with an XmlTextReader wrapping a FileStream. I
got an XmlException about "cannot switch to Unicode" or something.
Changing the from this:
<?xml version="1.0" encoding="utf-16"?>
to this
<?xml version="1.0" encoding="utf-8"?>
lets it run - why?
That sounds to me as if the XML document created "by hand" has a BOM
indicating UTF-8 while you inserted an XML declaration declaring the
encoding as UTF-16. So check how you saved the XML document, your editor
might allow you to choose the encoding, if you want UTF-16 then make
sure you save with that encoding.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/