[Mono-bugs] [Bug 727962] New: JsonValue has an incorrect ToString behavior

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Nov 3 03:17:11 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=727962

https://bugzilla.novell.com/show_bug.cgi?id=727962#c0


           Summary: JsonValue has an incorrect ToString behavior
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.8.x
          Platform: x86
        OS/Version: Windows 7
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: phoenix-cc at hotmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like
Gecko) Chrome/15.0.874.106 Safari/535.2

Code:
JsonPrimitive a = new JsonPrimitive("<a href=\"\"/>");
Console.WriteLine(a.ToString());

Output:   "<a href=\""/>"
Ideal:    "<a href=\"\"/>"

It's perhaps caused by JsonValue.cs line 218 & 219 in the method string
DoEscapeString (StringBuilder sb, string src, int cur).
Current:
    sb.Append(src[i++]);
    start = i;
Should be:
    sb.Append(src[i]);
    start = i + 1;





Reproducible: Always

Steps to Reproduce:
JsonPrimitive a = new JsonPrimitive("<a href=\"\"/>");
Console.WriteLine(a.ToString());
Actual Results:  
"<a href=\""/>"

Expected Results:  
"<a href=\"\"/>"

-- 
Configure bugmail: https://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.


More information about the mono-bugs mailing list