Menu

#7 Strings nor properly parsed.

open
nobody
1
2013-03-16
2013-03-15
Sean French
No

A valid string in the for

"VirtualSystemIdentifiers": "{
4AD8604A-0209-4196-8CDE-90683A8E320C
}",
As part of an object is not properly parsed.

Discussion

  • Sean French

    Sean French - 2013-03-15

    Note: Newline and Tab are inside the string.

     
  • modernskyangel

    modernskyangel - 2013-03-15

    actually parser is right - this is not valid string.
    other persers for this string say same:

    http://jsonlint.com/?json={%22VirtualSystemIdentifiers%22:%20%22{%0A4AD8604A-0209-4196-8CDE-90683A8E320C%0A}%22}

    (where "%0A" in url is just urlencoded newline character)

     
  • Sean French

    Sean French - 2013-03-16

    See www.json.org and the definition for string. It ver clearly talks to the legality of \n \r \t .

     
  • modernskyangel

    modernskyangel - 2013-03-16

    yes.
    very legality:
    {"test":"te\nst"} - raw string
    {"test":"te\\nst"} - escaped string
    but not a:
    {"test":"te
    st"}

    more examples here: https://www.google.com/search?q=json+newline+in+string

     

    Last edit: modernskyangel 2013-03-16

Log in to post a comment.

Auth0 Logo