记录 BufferedReader br = new BufferedReader(new FileReader(fileName)); String line = null; while ((line = br.readLine()) != null) { System.out.println(line); } br.close(); 原因:Java读取数据流的时候,如果没有指定数据流的编码方式,则将使用本地环境中的默认字符集。 So! BufferedReader br=new BufferedReader(new InputStreamReader(new FileInputStream(fileName),"UTF-8")); String line = null; while ((line = br.readLine()) != null) { System.out.println(line); //乱码消失 } br.close(); Previous php文件下载函数 Next 将腾讯视频下载为MP4格式 CATALOG FEATURED TAGS Windows Linux MySQL JavaScript Python Caffe Android java php linux React 计算机网络 收藏 Docker Nginx PHP FRIENDS My Github