我想用希伯来语读取文本文件,但我得到了一些犹太人......
这是我的代码:
try {
workFile =new File("tripShosWork.txt");
homeFile =new File("tripShosHome.txt");
BufferedReader homeBr = new BufferedReader(new FileReader(homeFile));
BufferedReader workBr = new BufferedReader(new FileReader(workFile));
home = new String [98];
for (int i = 0; i < home.length; i++)
home[i] = homeBr.readLine();
work = new String [19];
for (int i = 0; i < work.length; i++) {
work[i] = workBr.readLine();
}
} catch (Exception e) {
e.printStackTrace();
}
System.out.println(Arrays.toString(work));
System.out.println(Arrays.toString(home));
我需要你的帮助!
答案 0 :(得分:2)
你可以这样做:
FileInputStream fis = new FileInputStream("tripShosWork.txt");
InputStreamReader in = new InputStreamReader(fis, "Cp1255");
这假设该文件采用Windows希伯来语编码。使用"ISO8859_8"
表示Latin-8。