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);

上一篇下一篇

猜你喜欢

热点阅读