Given the code below, what encoding will test.xml be?
var filePath = @"C:\TEMP\test.xml";
using (var fileStream = new FileStream(filePath, FileMode.OpenOrCreate))
{
fileStream.SetLength(0);
var xmlSerializer = new XmlSerializer(typeof(string));
xmlSerializer.Serialize(fileStream, "HELLO WORLD");
}
By default StreamWriter uses UTF-8 Encoding, so your test.xml will be in UTF-8. More details are here