[Mono-bugs] [Bug 38421][Min] New - ASCIIEncoder::GetString(byte[],int,int) throws unwanted exception

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Thu, 20 Feb 2003 16:05:08 -0500 (EST)


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 jkdoug@psu.edu.

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

--- shadow/38421	Thu Feb 20 16:05:08 2003
+++ shadow/38421.tmp.19538	Thu Feb 20 16:05:08 2003
@@ -0,0 +1,35 @@
+Bug#: 38421
+Product: Mono/Class Libraries
+Version: unspecified
+OS: Red Hat 7.3
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jkdoug@psu.edu               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: ASCIIEncoder::GetString(byte[],int,int) throws unwanted exception
+
+Description of Problem:
+
+I am reading a stream of bytes as part of a network packet. Microsoft's 
+framework is successful in translating the bytes into a string. The same 
+code under Mono throws an exception. I have compared the SSCLI code for 
+ASCIIEncoding to the Mono code and found a few minor differences in the 
+code. It should be a simple fix, if the problem can be reproduced by a 
+Mono developer.
+
+
+Sample code (without variable contents - sorry):
+
+// In an unsafe context, of course...
+string strDevice = new ASCIIEncoding().GetString(replyData, 
+sizeof(DeviceRequestResp) - MAX_DEVICE_STRING_LEN, MAX_DEVICE_STRING_LEN);
+
+Console.WriteLine("Access to device: {0}", strDevice);