Adding unit test to show the problem reported in LANG-339 - namely that Chinese, Japanese etc characters are escaped. Furthermore the test notes that they are not subsequently unescaped; which means a lack of symmetry.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@795593 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2009-07-19 18:41:14 +00:00
parent 0331f1e5b6
commit 0bfa6b451e
1 changed files with 12 additions and 0 deletions

View File

@ -418,4 +418,16 @@ public void testEscapeHtmlHighUnicode() throws java.io.UnsupportedEncodingExcept
assertEquals( "High unicode was not escaped correctly", "𝍢", escaped); assertEquals( "High unicode was not escaped correctly", "𝍢", escaped);
} }
// https://issues.apache.org/jira/browse/LANG-339
public void testEscapeHiragana() throws java.io.UnsupportedEncodingException {
// Some random Japanese unicode characters
String escaped = StringEscapeUtils.escapeHtml( "\u304B\u304C\u3068" );
assertEquals( "Hiragana character unicode behaviour has changed from their being escaped",
"かがと", escaped);
String unescaped = StringEscapeUtils.unescapeHtml( escaped );
assertEquals( "Hiragana character unicode behaviour has changed - expected no unescaping", escaped, escaped);
}
} }