File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/test/java/org/json/junit Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -782,11 +782,20 @@ public void testUnescape() {
782782 XML .toJSONObject ("<xml>Can cope &; </xml>" ).toString ());
783783 assertEquals ("Can cope &; " , XML .unescape ("Can cope &; " ));
784784
785+ // unicode entity
786+ assertEquals ("{\" xml\" :\" Can cope 4;\" }" ,
787+ XML .toJSONObject ("<xml>Can cope 4; </xml>" ).toString ());
788+ assertEquals ("Can cope 4; " , XML .unescape ("Can cope 4; " ));
789+
785790 // double escaped
786791 assertEquals ("{\" xml\" :\" Can cope <\" }" ,
787792 XML .toJSONObject ("<xml>Can cope &lt; </xml>" ).toString ());
788793 assertEquals ("Can cope < " , XML .unescape ("Can cope &lt; " ));
789794
790- }
795+ assertEquals ("{\" xml\" :\" Can cope 4\" }" ,
796+ XML .toJSONObject ("<xml>Can cope &#x34; </xml>" ).toString ());
797+ assertEquals ("Can cope 4 " , XML .unescape ("Can cope &#x34; " ));
798+
799+ }
791800
792801}
You can’t perform that action at this time.
0 commit comments