2

unescapeJson seems to do nothing in 1.2 - It worked correctly in commons-lang3 3.6

The unit tests in the package seem weird to me:

@Test
public void testUnescapeJson() {
    final String jsonString =
            "{\"age\":100,\"name\":\"kyong.com\n\",\"messages\":[\"msg 1\",\"msg 2\",\"msg 3\"]}";

    assertEquals("", StringEscapeUtils.unescapeJson(""));
    assertEquals(" ", StringEscapeUtils.unescapeJson(" "));
    assertEquals("a:b", StringEscapeUtils.unescapeJson("a:b"));
    assertEquals(jsonString, StringEscapeUtils.unescapeJson(jsonString));
}

it actually asserts that it does nothing, or am I missing something?

Is there a workaround? I thought of using unescapeJava, but not sure it would do exactly the same thing

ModdyFire
  • 706
  • 3
  • 9
  • 19
  • I see the same thing happening... Ever figure this out? – technocrat Jun 06 '18 at 18:24
  • https://issues.apache.org/jira/browse/TEXT-120?jql=project%20%3D%20TEXT%20AND%20text%20~%20%22unescapeJson%22%20ORDER%20BY%20created%20DESC This looks like the issue... possibly fixed in 1.4 – technocrat Jun 06 '18 at 18:43

0 Answers0