下面附上java代码,main方法中采用utf-16le编码,最后调用了utf8编码的方法,最后会输出两种编码格式的csv文件: importjava.io.*;/** * Created by zhaozhi on 15-5-29. */publicclassTestCSV{publicstaticStringjoin(String[] strArr, String delim){StringBuildersb=newStringBuilder();for(String s : strArr)...
public static void UTF8() throws IOException { String line = "中文,标题,23"; OutputStream os = new FileOutputStream("d:/utf-8.csv"); os.write(239); // 0xEF os.write(187); // 0xBB os.write(191); // 0xBF PrintWriter w = new PrintWriter(new OutputStreamWriter(os, "UTF-8"))...