java读取txt数据出乱码

小猪 2年前

用java读取txt文件中的内容:
bufferedReader = new BufferedReader(new InputStreamReader(
new FileInputStream(filePath),"GBK"));
String line = null;
while ((line = bufferedReader.readLine()) != null) {
System.out.println(line);}
但是出来乱码。

*
*