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

解決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文件中文乱码)