[Mono-bugs] [Bug 76374][Nor] Changed - Binary.PeekChar Bug

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Nov 1 20:39:23 EST 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by zac at zacbowling.com.

http://bugzilla.ximian.com/show_bug.cgi?id=76374

--- shadow/76374	2005-11-01 09:08:32.000000000 -0500
+++ shadow/76374.tmp.8763	2005-11-01 20:39:23.000000000 -0500
@@ -1,13 +1,13 @@
 Bug#: 76374
 Product: Mono: Class Libraries
 Version: 1.1
 OS: unknown
 OS Details: 
-Status: ASSIGNED   
-Resolution: 
+Status: RESOLVED   
+Resolution: NOTABUG
 Severity: Unknown
 Priority: Normal
 Component: System
 AssignedTo: mono-bugs at ximian.com                            
 ReportedBy: gonzaloantonio at gmail.com               
 QAContact: mono-bugs at ximian.com
@@ -83,6 +83,32 @@
 Image used in test case
 
 
 ------- Additional Comments From gonzaloantonio at gmail.com  2005-11-01 09:08 -------
 i use that image only for test, but with any file over 500KB size, 
 crash equal.
+
+------- Additional Comments From zac at zacbowling.com  2005-11-01 20:39 -------
+Microsoft .NET borks on this as well. It happens for the same reason 
+we bork on as well. Because the byte its trying to read isn't a 
+character and its trying to decode UTF-8 and UTF-8 char isn't always 
+one byte, it trys to keep reading till it decides this can't be 
+represented as a char even if its garabled. 
+
+I suggest just checking the binaryReader.BaseStream.CanSeek property 
+instead as it is what tells you the "-1" return code anyways. 
+
+
+
+MS.NET error:
+Unhandled Exception: System.ArgumentException: Conversion buffer 
+overflow.
+   at System.Text.UTF8Encoding.GetChars(Byte[] bytes, Int32 
+byteIndex, Int32 byt
+eCount, Char[] chars, Int32 charIndex, UTF8Decoder decoder)
+   at System.Text.UTF8Decoder.GetChars(Byte[] bytes, Int32 byteIndex, 
+Int32 byte
+Count, Char[] chars, Int32 charIndex)
+   at System.IO.BinaryReader.InternalReadOneChar()
+   at System.IO.BinaryReader.Read()
+   at System.IO.BinaryReader.PeekChar()
+   at Foo.Main()


More information about the mono-bugs mailing list