I searched many places for the answer but couldn't find it.
I'm using a XmlSerializer to generate an XML, and I need it in ISO-8859-1 encoding. I managed to do it this way:
var encoding = Encoding.GetEncoding("ISO-8859-1");
using (StreamWriter writer = new StreamWriter(outfile, appendMode, encoding))
{
XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
ns.Add("", "");
serializer.Serialize(writer, DTE, ns);
writer.Close();
}
The xml is OK, but the system where I need to send the XML to is case-sensitive in the encoding word, so it just accepts my file it it says encoding="ISO-8859-1" and doesn't when it says "iso-8859-1".
What can I do? Thank you in advance.