This should hopefully be a simple one.I am serializaing a List<> of C# objects to an XML document. Everything is going great however my XML document has ASCII encoding (spaces are represented as \[code\]X0020\[/code\] for example) and the client is complaining so I want to change the encoding to UTF8 like so:\[code\]private void SerializeToXML(List<ResponseData> finalXML){ XmlSerializer serializer = new XmlSerializer(typeof(List<ResponseData>)); TextWriter textWriter = new StreamWriter(txtFileLocation.Text, Encoding.UTF8); serializer.Serialize(textWriter, finalXML); textWriter.Close();}\[/code\]Intellisense is telling me this should work...
...but is complaining when I try it...
What am I doing wrong?Thanks