从.txt文件中获取阿拉伯语文本?

时间:2011-03-23 10:11:50

标签: android arabic

嘿 我在txt文件中有阿拉伯语文本,我想在一个简单的EditText中显示, 虽然我这样做是我得到的: http://i55.tinypic.com/66g09z.png

以下是我用来从.txt文件中获取文本的代码:

    txt1 =(EditText) findViewById(R.id.EditText01); 

    try{

           File f = new File(Environment.getExternalStorageDirectory()+"/1.txt");
           FileInputStream fileIS = new FileInputStream(f);          
           BufferedReader buf = new BufferedReader(new InputStreamReader(fileIS));           
           String readString = new String();             

           //just reading each line
           while((readString = buf.readLine())!= null){          
               txt1.setText(txt1.getText().toString()+readString);                
           }             
        } catch (FileNotFoundException e) {

           e.printStackTrace();

        } catch (IOException e){

           e.printStackTrace();          
        }

}

如何在EditText中输入正确的阿拉伯字母? 感谢

2 个答案:

答案 0 :(得分:2)

您需要确保安装了带有阿拉伯字符的字体,并将EditText的字体设置为它。前者是烦人的部分。 (我想我让SwiftKey告诉它下载相应的语言模块。)

答案 1 :(得分:1)

你运行的是什么版本的android?在2.3版本之前,Android不支持阿拉伯语语言环境。您可以在相应的SDK页面上找到有关区域设置的更多信息。例如,SDK 2.3支持的区域设置列表为here

相关问题