因为条件有限,只测试了这⼏个版本,可见utf-16le是更通⽤的编码格式。下⾯附上java代码,main⽅法中采⽤utf-16le编码,最后调⽤了utf8编码的⽅法,最后会输出两种编码格式的csv⽂件:import java.io.*;/** * Created by zhaozhi on 15-5-29.*/ public class TestCSV { public static ...
bo.close(); UTF8(); } 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 OutputS...