码迷,mamicode.com
首页 > 其他好文 > 详细

解決BufferedReader BufferedWrite 读写UTF-8文件中文乱码

时间:2015-05-04 18:24:18      阅读:119      评论:0      收藏:0      [点我收藏+]

标签:

解決BufferedReader读取UTF-8文件中文乱码
         File rst01 = new File(context.getRealPath("/")+"zljb0.html");
         File rst02 = new File(context.getRealPath("/")+"zljb.html");

         InputStreamReader isr = new InputStreamReader(new FileInputStream(rst01), "UTF-8");
         BufferedReader reader = new BufferedReader(isr);
         OutputStreamWriter writerStream = new OutputStreamWriter(new FileOutputStream(rst02),"UTF-8");
         BufferedWriter writer = new BufferedWriter(writerStream);

读写编码需一致

解決BufferedReader BufferedWrite 读写UTF-8文件中文乱码

标签:

原文地址:http://my.oschina.net/airship/blog/410490

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!