创建xml时,设置xml编码问题

时间:2023-03-08 18:31:34

OutputFormat format = OutputFormat.createPrettyPrint(); 
   format.setEncoding("GBK"); 
XMLWriter output = new XMLWriter(new FileWriter(new File("c:/catalog.xml")),format); 
output.write(document);

相关文章