Forcing StreamWriter to change Encoding
Just wrap it in a FileStream. StreamWriter sw = new StreamWriter( new FileStream(saveFileDialog1.FileName, FileMode.Open, FileAccess.ReadWrite), Encoding.UTF8 ); If you want to append, use FileMode.Append instead. You should also call Dispose() on a try/finally block, or use a using block to dispose the object when it exceeds the using scope: using( var sw = new StreamWriter( … Read more