mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-08-18 20:38:02 +08:00
fix escape bug
This commit is contained in:
@@ -14,4 +14,15 @@ public class XMLTest {
|
||||
Assert.assertEquals("<aaa>你好</aaa><键2>test</键2>", s);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void escapeTest(){
|
||||
String xml = "<a>•</a>";
|
||||
JSONObject jsonObject = XML.toJSONObject(xml);
|
||||
|
||||
Assert.assertEquals("{\"a\":\"•\"}", jsonObject.toString());
|
||||
|
||||
String xml2 = XML.toXml(JSONUtil.parseObj(jsonObject));
|
||||
Assert.assertEquals(xml, xml2);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user