I get the following error (which I see on other SO posts):
There is no Unicode byte order mark. Cannot switch to Unicode.
I see on other SO posts that users swith:
<?xml version="1.0" encoding="utf-16"?>
to:
<?xml version="1.0" encoding="utf-8"?>
I cannot update all my importing XMLs on the fly to switch this so I want to know how to do it programmatically. I have the following code where the
private static string ParseXML(Stream xmlSteam)
{
using (var xmlReader = XmlReader.Create(xmlSteam))
{
// Errors out here with the unicode exception being caught
while (xmlReader.Read())
I am trying to fix it so it will read and parse the XML.