[Mono-bugs] [Bug 28050][Nor] New - System.UInt32.Parse(string) can't deal with trailing \u0000 but MS impl can.

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
21 Jul 2002 23:59:30 -0000


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 kiwnix@yahoo.es.

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

--- shadow/28050	Sun Jul 21 19:59:30 2002
+++ shadow/28050.tmp.693	Sun Jul 21 19:59:30 2002
@@ -0,0 +1,61 @@
+Bug#: 28050
+Product: Mono/Class Libraries
+Version: unspecified
+OS: GNU/Linux [Other]
+OS Details: debian sid with alp cvs packages
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: kiwnix@yahoo.es               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: System.UInt32.Parse(string) can't deal with trailing \u0000 but MS impl can.
+
+Description of Problem:
+
+Mono method System.UInt32.Parse() with a string for parameter and the
+string end in \u0000 trow a 
+unhandled exception System.FormatException: "Input string was not in the
+correct format."
+but MS .NET it runs without a problem
+
+Actual Results: (executing the test case)
+30
+
+** (process:23154): WARNING **: unhandled exception System.FormatException:
+"Input string was not in the correct format."
+in <0x00cda> System.UInt32:Parse
+(string,System.Globalization.NumberStyles,System.IFormatProvider)
+in <0x00054> .test1:Main ()
+
+
+Expected Results: (in MS .NET)
+
+30
+30
+
+Additional Information:
+
+Test Case:
+
+using System;
+using System.Globalization;
+
+class test1
+{
+        public static void Main()
+        {
+                string test_str = "30\u0000\u0000";
+                uint test_uint32 = 0;
+
+                Console.WriteLine("{0}",test_str);
+                test_uint32 =
+UInt32.Parse(test_str,NumberStyles.AllowTrailingWhite);
+                Console.WriteLine("{0}",test_uint32);
+        }
+}