OutputFormat format = OutputFormat.createPrettyPrint();
format.setEncoding("UTF-8"/"gb2312");
XMLWriter writer = new XMLWriter(new FileOutputStream(url),format);----字节流处理最好
注意:XMLWriter writer = new XMLWriter(new FileWriter(url))可能乱码。----字符流不查码表(默认gb312)
原文链接:https://www.f2er.com/xml/297456.html