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() {
782
782
XML .toJSONObject ("<xml>Can cope &; </xml>" ).toString ());
783
783
assertEquals ("Can cope &; " , XML .unescape ("Can cope &; " ));
784
784
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
+
785
790
// double escaped
786
791
assertEquals ("{\" xml\" :\" Can cope <\" }" ,
787
792
XML .toJSONObject ("<xml>Can cope &lt; </xml>" ).toString ());
788
793
assertEquals ("Can cope < " , XML .unescape ("Can cope &lt; " ));
789
794
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
+ }
791
800
792
801
}
You can’t perform that action at this time.
0 commit comments