title: How do I write out a text file in C# with a code page other than UTF-8?
body: <p>I want to write out a text file.</p>
  
  <p>Instead of the default UTF-8, I want to write it encoded as ISO-8859-1 which is code page 28591. I have no idea how to do this...</p>
  
  <p>I'm writing out my file with the following very simple code:</p>
  
  <pre><code>using (StreamWriter sw = File.CreateText(myfilename))
  {
      sw.WriteLine("my text...");
      sw.Close();
  }
  </code></pre>