OutputStream fo = null; fo = new FileOutputStream(Common.strSLExtXMLWritePath+"lists"+xmlURL); //set output file path and name.
osw = new OutputStreamWriter(fo,"UTF-8");
BufferedWriter bfw=new BufferedWriter(osw);
bfw.write(new String(StrXMl.toString().getBytes("UTF-8"),"UTF-8"));
System.out.println(Common.strSLExtXMLWritePath+"lists"+xmlURL);
bfw.flush();
bfw.close();已解决,通过设置编码方式可以将xml正确保存.
osw = new OutputStreamWriter(fo,"UTF-8");
BufferedWriter bfw=new BufferedWriter(osw);
bfw.write(new String(StrXMl.toString().getBytes("UTF-8"),"UTF-8"));
System.out.println(Common.strSLExtXMLWritePath+"lists"+xmlURL);
bfw.flush();
bfw.close();已解决,通过设置编码方式可以将xml正确保存.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货