Kyle Alons [mailto:[EMAIL PROTECTED]] wrote:
> I wish it were that simple, but it doesn't work. It writes a > question mark char (ascii 0x3F) to the file. I originally > looked at the ASCIIEncoding class, but the docs state that it > only supports chars through 0x7F (7 bits). Any other ideas? Oh, sorry I didn't actually mean you should use ASCIIEncoding since, as you found out, it only supports 7 bits. The example was just meant to show how to choose an Encoding for the StreamWriter. If you want the windows 1252 codepage you should create the Encoding like so: <codeSnippet language="C#"> Encoding windows1252Encoding = Encoding.GetEncoding(1252); </codeSnippet> Just pass that to the constructor instead of the Encoding.ASCII and the rest of the code remains the same. HTH, Drew You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.