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:
parent
0331f1e5b6
commit
0bfa6b451e
|
@ -418,4 +418,16 @@ public class StringEscapeUtilsTest extends TestCase {
|
|||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue