I try to encode a string in Windows-1252 with a StreamWriter. The input string (dataString) is encode in UTF8.
StreamWriter sw = new StreamWriter(@"C:\Temp\data.txt", true, Encoding.GetEncoding(1252)); sw.Write(dataString); sw.Close(); When I open the file in Notepad++ I get a ANSI file. I need a Windows-1252 encoded file.
Someone have an idea?