こんにちは私はAndroidアプリケーションでヘブライ語の文字を含むUTF-8でエンコードされたtxtファイルを読み込もうとしていますが、なんらかの理由で「a」文字が常に文字列の先頭に追加されています。どうして
これが私のコードです:
void Read(){
try {
File fileDir = new File("/sdcard/test.txt");
BufferedReader in = new BufferedReader( new InputStreamReader(
new FileInputStream(fileDir), "UTF8"));
String str;
while ((str = in.readLine()) != null) {
Log.i("TEST",str);
}
in.close();
}
catch (UnsupportedEncodingException e)
{
System.out.println(e.getMessage());
}
catch (IOException e)
{
System.out.println(e.getMessage());
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
}
これは私が得た結果です
05-15 01:53:25.269:INFO / TEST(16236):אבגדהוזחטיכלמנסעפצקרשת a