title: How to replace encoding=utf-8 in the xml header with an empty string using XmlTextWriter?
body: <p>I am using XmlTextWriter in C# to generate XML's from CSV's and in the result XML I am getting the following header <code>&lt;xml version="1.0" encoding="utf-8"&gt;</code> and the problem is to replace this encoding=utf-8 with an empty string so that the header becomes <code>&lt;xml version="1.0"?&gt;</code>. I have searched a lot and have not been able to find anything as of now. Would love to know solutions to combat this problem. The piece of code that generates this is as follows -:</p>
  
  <pre><code>var writer = new XmlTextWriter(s, Encoding.UTF8) {
                      Formatting = Formatting.Indented
                  };
  writer.WriteStartDocument();
  </code></pre>