从.txt文件获取阿拉伯文字? [英] Getting Arabic text from .txt file?

查看:131
本文介绍了从.txt文件获取阿拉伯文字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Hey, I have Arabic text in a txt file that I would like to show in a simple EditText, Though when I do that here is what I get: http://i55.tinypic.com/66g09z.png

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

Here is the code I use to get the text from the .txt file:

    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? 谢谢

How can I get proper Arabic letters into the EditText? Thanks

推荐答案

您运行的是哪个版本的android?直到2.3版本,Android才不支持阿拉伯语区域设置.您可以在相应的SDK页面上找到有关支持的语言环境的更多信息.例如,此处.

What version of android do you run? Android has no support for Arabic locales up until 2.3 version. You can find more info about locales supported on corresponding SDK pages. For example, list of SDK 2.3 supported locales is here.

这篇关于从.txt文件获取阿拉伯文字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆