[Mono-list] Fix for StreamWriter

Miguel de Icaza miguel@ximian.com
06 Nov 2002 19:06:33 -0500


Hello,

>    StreamWriter sw = new StreamWriter("myfile.txt");
> 
> ...you'll get spurious bytes before and after all of the text you write
> to the stream. I managed to track it down, the StreamWriter's
> UTF8Encoding object is writing the UTF8 identifier into the output. The
> fix is simple: in mcs/class/corlib/System.IO/StreamWriter.cs lines 67
> and 70, replace 'Encoding.UTF8' with 'new UTF8Encoding(false,true)'.

Thanks for pointing this out, I have now fixed this.

Miguel