- //指定输出流的编码格式 utf-8
- OutputStreamWriter osw=new OutputStreamWriter(new FileOutputStream("utf_8.txt"),"UTF-8");
- osw.write("神奇的我");
- osw.close();
-
- //指定输入流的编码格式 utf-8
- InputStreamReader isw=new InputStreamReader(new FileInputStream("utf_8.txt"),"UTF-8");
- isw.close();
使用转换流 解决I/O 读写文件乱码问题
最新推荐文章于 2024-08-13 14:00:13 发布