日期:2014-05-18  浏览次数:20664 次

写入xml时出现乱码!
写入xml时出现乱码问题,我用的是org.apache.crimson,tree.XmlDocument   来写入的,请问我用utf-8怎么来转换,等~~~

------解决方案--------------------
写入之前,把String new一下
例如
String str = "你好 ";
str = new String(str.getBytes( "ISO8859-1 "), "UTF-8 ");
------解决方案--------------------
记得dom4j可以确定写入的是什么格式,我想你那api中也应该有吧