title: XmlSerializer Utf-8 encoding
body: <p>Consider the code below</p>
  
  <pre><code>  XmlSerializer serializer = new XmlSerializer(typeof(Invoice));
  
    using (TextWriter writer = new StreamWriter(fileName))
    {
      // Serialize the object, and close the TextWriter.
      serializer.Serialize(writer, invoice);
      writer.Close();
    }
  </code></pre>
  
  <p>No encoding is set on the stream writer by default. Does it default to UTF-8 if you don't set an encoding on the stream writer?</p>