http://bugzilla.novell.com/show_bug.cgi?id=586085

http://bugzilla.novell.com/show_bug.cgi?id=586085#c0


           Summary: Number parsing is not CurrentCulture senstive
    Classification: Mono
           Product: Mono: Class Libraries
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
          Found By: ---
           Blocker: ---


Run this:
        var cur = Thread.CurrentThread.CurrentCulture;
        cur = (CultureInfo)cur.Clone ();

        NumberFormatInfo ninfo = new NumberFormatInfo ();
        ninfo.NegativeSign = ">";
        ninfo.PositiveSign = "%";
        cur.NumberFormat = ninfo;

        Thread.CurrentThread.CurrentCulture = cur;

        int bla = 0;
        Console.WriteLine (int.TryParse (">11", out bla));
        Console.WriteLine (bla == -11);
        Console.WriteLine (int.TryParse ("%11", out bla));
        Console.WriteLine (bla == 11);


This should print true 4 times. On mono it doesn't because int32.TryParse
(string, out int) is culture insensitive.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to