Uploaded image for project: 'Commons Text'
  1. Commons Text
  2. TEXT-120

StringEscapeUtils#unescapeJson does not unescape double quotes and forward slash

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2, 1.3
    • 1.4
    • None

    Description

      Here's a unit test to show how the escape/unescape cycle doesn't return expected String.

       

      @Test
      public void testUnscape() {
        String unscapeString = "double quote: \" and a forward slash: /";
        String escapeString = StringEscapeUtils.escapeJson(unscapeString);
      
        assertEquals("double quote: \" and a forward slash: \/", escapeString);
        assertEquals(unscapeString, StringEscapeUtils.unescapeJson(escapeString));
      }
      

      Attachments

        Issue Links

          Activity

            People

              pascalschumacher Pascal Schumacher
              Robles Pedro Robles
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: