File1内容:
AddressBlock1|AddressBlock2
Main Rd. 1|Westpunt
EOL是Windows,编码是UTF8
要阅读的Java代码段:
Scanner sc = new Scanner(new File(File1),"UTF-8");
while (sc.hasNextLine()) {
String line=sc.nextLine();
System.out.println(line);
}
输出:
?AddressBlock1|AddressBlock2
Main Rd. 1|Westpunt
它附加?在第一行。可能是什么原因?