I call WebService and get the string returned from WebMethod. A string is an object serialized as XML that should be deserialized using System.Xml.XmlSerializer.
My problem is that the first line indicates that the document is UTF-16 encoded:
<?xml version="1.0" encoding="utf-16"?>
Therefore, when deserializing, I get an error message:
There is an error in XML document (0, 0).
This works to execute string.Replace ("utf-16", "utf-8"), but should there be a clean method to know the XmlSerializer?
source share