处理java在解析csv文件包含日语文字乱码,导出成csv时日语部分数据乱码问题

解析时:InputStream inputStream = file.getInputStream();

InputStreamReader is =new InputStreamReader(inputStream,"utf-8");

注意在生成输入流时设置utf-8编码。

导出时(这里是使用PrintWriter):在生成输出流时设置utf-8编码

Writer write =new OutputStreamWriter(new FileOutputStream(new File(file,fileName)), "UTF-8");

PrintWriter printWriter=new PrintWriter(write);

你可能感兴趣的:(处理java在解析csv文件包含日语文字乱码,导出成csv时日语部分数据乱码问题)