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

StringEscapeUtils#unescapeJson does not unescape double quotes and forward slash

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2, 1.3
    • Fix Version/s: 1.4
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: