InputStreamReader isr = new InputStreamReader(new FileInputStream("D:\\File_sum\\新建文本文档.txt"),"GBK");//使用UTF-8还是乱码 使用GBK中文显示就正常了
BufferedReader br= new BufferedReader(isr);
String s = null;
StringBuilder sBuilder = new StringBuilder();
while ((s=br.readLine())!=null) {
sBuilder.append(s);
}
br.close();
isr.close();
System.out.println(sBuilder);
BufferedReader 读取中文乱码
最新推荐文章于 2024-07-08 16:07:10 发布