FileReader、FileWriter默认字符集是平台的,那么是Eclipse中的设置的吗,还是跟操作系统有关系?我Eclipse设置的UTF-8,那
OutputStreamWriter osw1 = new OutputStreamWriter(new FileOutputStream("D:\\test1.txt"), "GB2312");
OutputStreamWriter osw2 = new OutputStreamWriter(new FileOutputStream("D:\\test2.txt"), "UTF-8");
FileWriter fw = new FileWriter("D:\\test.txt");
osw1、osw2哪个写入的结果与fw不一样
|
|