我有一个带有非ASCII字符的文件,如
set myval;[2K[DESC[DESC[D
我有一个Java代码来读取文件
public static void main(String[] args) {
BufferedReader br = null;
try {
String sCurrentLine;
br = new BufferedReader(new FileReader("output.txt"));
while ((sCurrentLine = br.readLine()) != null) {
System.out.println(sCurrentLine);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (br != null) {
br.close();
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
在Netbeans中,未显示非ASCII,但在Eclipse控制台中,这些字符按原样显示。 我想知道Netbeans如何删除这些字符,因为我需要清理那些非ASCII字符的文件。
谢谢