Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-131

Non-escaping backslash characters are not ignored when parsing JSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1
    • Component/s: None
    • Labels:
      None
    • Environment:
      Mac OS X, Java(TM) SE Runtime Environment (build 1.6.0_20-b02-279-10M3065)
    • Backwards Compatibility:
      Minor Change
    • # Replies:
      0
    • Last comment by Customer:
      true

      Description

      When using the built-in JSON parser, single backslashes are included in the resulting string. This is especially annoying as some JSON libraries escape forward slashed with backslashes. According to JSON spec, "\/" is a valid escape characer (see: http://tech.groups.yahoo.com/group/json/message/249).

      For example, the literal string "va\lue" interpreted as "va\lue" but any sane JS interpreter parses it as "value".

      I've created a patch on GitHub, which makes the JSON parser behave like other JS interpreters. http://github.com/lautis/mongo-java-driver

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                7 years, 23 weeks, 2 days ago