我尝试使用juniversalchardet
来读取文本文件。
FileReader in = new FileReader(my_file);
java.io.Reader reader = null;
BufferedReader br = new BufferedReader(in);
try {
reader = ReaderFactory.createBufferedReader(my_file);
while ((line = ((BufferedReader)reader).readLine()) != null) {
System.out.println(line);
}
} finally {
if (reader != null) {
reader.close();
}
}
我收到错误消息:
java.lang.NoSuchMethodError: org.mozilla.universalchardet.UniversalDetector.detectCharset(Ljava / io / File;)Ljava / lang / String;