Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-797

StringEscapeUtils.escapeJson

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.6
    • None
    • lang.*

    Description

      It would be great to offer a StringEscapeUtils.escapeJson method which is similar to StringEscapeUtils.escapeJavaScript but will not escape apostrophe (single-quote) chars.

      The current escapeJavaScript method does escape single-quote chars, but this produces invalid JSON. A good description of the problem can be found here:

      http://stackoverflow.com/questions/2275359/jquery-single-quote-in-json-response

      Attachments

        1. LANG-797.patch
          7 kB
          Maurizio Cucchiara

        Issue Links

          Activity

            People

              Unassigned Unassigned
              japher Joe Littlejohn
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: