You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Pedro (JIRA)" <ji...@apache.org> on 2018/02/26 15:58:00 UTC
[jira] [Updated] (TEXT-120) StringEscapeUtils UnescapeJson does not
unescape
[ https://issues.apache.org/jira/browse/TEXT-120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pedro updated TEXT-120:
-----------------------
Description:
Here's a unit test to show how the escape/unescape cycle doesn't return expected String.
{code:java}
// marcador de posición de código
@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));
}
{code}
was:
Here's a unit test to show how the escape/unescape cycle doesn't return expected String.
@Testpublic 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));
}
> StringEscapeUtils UnescapeJson does not unescape
> ------------------------------------------------
>
> Key: TEXT-120
> URL: https://issues.apache.org/jira/browse/TEXT-120
> Project: Commons Text
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: Pedro
> Priority: Major
>
> Here's a unit test to show how the escape/unescape cycle doesn't return expected String.
>
> {code:java}
> // marcador de posición de código
> @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));
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)