我尝试使用以下两种方式在 Java 中读取 ANSI 编码的阿拉伯语文件
Scanner scanner = null;
try {
scanner = new Scanner(new File("test/input.txt"), "ISO-8859-6");
while (scanner.hasNextLine()) {
String input =scanner.nextLine();
processString(input);
}
我也尝试使用默认编码读取(即我省略了“ISO-8859-6”)
有什么建议么?