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

StringEscapeUtils.escapeJson

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: None
    • Component/s: lang.*
    • Labels:

      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

        Issue Links

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              japher Joe Littlejohn

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment