I want to write out a text file.
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...
Change the Encoding of the stream writer. It's a property.
http://msdn.microsoft.com/en-us/library/system.io.streamwriter.encoding.aspx
So:
sw.Encoding = Encoding.GetEncoding(28591);
Prior to writing to the stream.