日期:2014-05-20  浏览次数:20634 次

如何把FileWriter的编码方式改成日文啊!急!!!
FileWriter fw =new FileWriter("..\\temp\\1.csv");
  for(int i =0 ;i < chkedLines.size()-1; i++){ fw.write(chkedLines.get(i).getUserCode()+","+chkedLines.get(i).getUserName()+",,"+chkedLines.get(i).getEmail()+","+chkedLines.get(i).getRemark()+",\r\n");
}
fw.close();

write方法里有日文老显示乱码,怎么把他的编码方式改为日文啊

------解决方案--------------------
new BufferedWriter(new OutputStreamWriter(new FileOutputStream(...), "ShiftJIS"))
日文是shiftjis吗?
------解决方案--------------------
你用OutputStreamWriter writer=new OutputStreamWriter(
new FileOutputStream("XXX"),"UTF-8"); 试试

探讨

OutputStreamWriter writer=new OutputStreamWriter(
new FileOutputStream("XXX"),"Shift-JIS");
没有效果还是出现乱码,怎么办?