2010-01-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
authorCarlos Alberto Cortez <calberto.cortez@gmail.com>
Sun, 24 Jan 2010 04:07:35 +0000 (04:07 -0000)
committerCarlos Alberto Cortez <calberto.cortez@gmail.com>
Sun, 24 Jan 2010 04:07:35 +0000 (04:07 -0000)
commit542171144bdfec015cf75c0d89fa11426eac264f
tree7b40defa4b94376cb819ebb2106af81021a3c728
parentc42abafd5bbed80b819904e95ae6b5af58e0be88
2010-01-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>

* StreamReader.cs: When detecting the encoding we usually check the
four first bytes looking for either UTF32 or UTF8 BOM, since they share
the first two bytes, but if we happen to have less than 4 bytes at
detection time, just check for Unicode and use it as the current
encoding - this is exactly what .Net does, and it is specially visible
with NetworkStream.
Fixes #534137.

svn path=/trunk/mcs/; revision=150090
mcs/class/corlib/System.IO/ChangeLog
mcs/class/corlib/System.IO/StreamReader.cs