D
darrel
I'm having a really odd problem that I can't find many other examples of.
I'm using XMLTextWriter and grabbing data from a database and then spitting
out an RSS-compliant XML file.
The problem I have is that, by default, IE pukes on it.
If I output the XMLTextWriter as:
XmlTextWriter(Response.OutputStream, Encoding.UTF8)
And let the page headers default, I end up with a UTF8 page encoding, but
the XMLtextWriter spits out the XML as such:
<?xml version="1.0" encoding="utf-16"?><rss version="2.0">...
IE doesn't like this as the XML encoding doesn't match the page encoding.
So, if I force the page to also be UTF-16, then both encodings match, but
apparently IE can't handle UTF-16, period. So I still get parsing errors
when loading the XML in the browser (there's a space between each and ever
character in the XML).
It appears that my solution is going to have to be to just make sure the
content from the DB is being retrieved as UTF-8 forcing everything to be
UTF-8. But I'm not sure how to do that. Can it be done?
-Darrel
I'm using XMLTextWriter and grabbing data from a database and then spitting
out an RSS-compliant XML file.
The problem I have is that, by default, IE pukes on it.
If I output the XMLTextWriter as:
XmlTextWriter(Response.OutputStream, Encoding.UTF8)
And let the page headers default, I end up with a UTF8 page encoding, but
the XMLtextWriter spits out the XML as such:
<?xml version="1.0" encoding="utf-16"?><rss version="2.0">...
IE doesn't like this as the XML encoding doesn't match the page encoding.
So, if I force the page to also be UTF-16, then both encodings match, but
apparently IE can't handle UTF-16, period. So I still get parsing errors
when loading the XML in the browser (there's a space between each and ever
character in the XML).
It appears that my solution is going to have to be to just make sure the
content from the DB is being retrieved as UTF-8 forcing everything to be
UTF-8. But I'm not sure how to do that. Can it be done?
-Darrel