commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r795593 - /commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java
Date Sun, 19 Jul 2009 18:41:14 GMT
Author: bayard
Date: Sun Jul 19 18:41:14 2009
New Revision: 795593

URL: http://svn.apache.org/viewvc?rev=795593&view=rev
Log:
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. 

Modified:
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java?rev=795593&r1=795592&r2=795593&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java
(original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java
Sun Jul 19 18:41:14 2009
@@ -418,4 +418,16 @@
 
         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);
+    }
 }



Mime
View raw message