我有一个带有西里尔字母和非西里尔字母的文件。但是,当我读取文件时,不会检索西里尔字符,而不会检索非西里尔字符。这是我正在使用的代码
private static String dirToPRocess = "D:\\stopwords_freq_v2.txt";
BufferedReader br = null;
try {
br = new BufferedReader(new InputStreamReader(new FileInputStream(
dirToPRocess), "UTF-8"));
String line = br.readLine();
while (line != null) {
System.out.println(line);
line = br.readLine();
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
br.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}