LANG-911 UTF8 4byte (un)escapeJava not work correctly

Add test to show that the bug report is incorrect

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1518116 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2013-08-28 09:17:47 +00:00
parent 9506e04548
commit 62f2412f14
1 changed files with 11 additions and 0 deletions

View File

@ -530,6 +530,17 @@ public class StringEscapeUtilsTest {
assertEquals(input, escaped);
}
/**
* Tests https://issues.apache.org/jira/browse/LANG-911
*/
@Test
public void testLang911() {
String bellsTest = "\ud83d\udc80\ud83d\udd14";
String value = StringEscapeUtils.escapeJava(bellsTest);
String valueTest = StringEscapeUtils.unescapeJava(value);
assertEquals(bellsTest, valueTest);
}
@Test
public void testEscapeJson() {
assertEquals(null, StringEscapeUtils.escapeJson(null));