BufferedReader 读取 txt 文件中文乱码
2018-12-11 本文已影响0人
黑黑的大猫
读取 txt 文件乱码:
BufferedReader read = new BufferedReader(new FileReader(new File(filenameString)));
解决乱码代码示例:
InputStreamReader isr = new InputStreamReader(new FileInputStream(filenameString), "UTF-8");
BufferedReader read = new BufferedReader(isr);