我正在開發一個阿拉伯語文本應用程序..我的手機支持阿拉伯語,所以文本顯示正確..奇怪的問題是,如果我複製一個阿拉伯文本,我想從a.txt文件,並把它到EditText中,EditText顯示奇怪的字符,但是如果我手動寫入SAME文本(而不是複製粘貼),文本將正常顯示!
這裏是在我的意思的圖片,第一個是的EditText我手動寫的文字,第二個是我複製粘貼文本從.txt文件..
某些阿拉伯文字得到錯誤顯示,而其他阿拉伯文字得到正常顯示?
這裏的代碼應用:
XML文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical">
<EditText android:text="EditText" android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content"></EditText>
<EditText android:text="EditText" android:id="@+id/editText2" android:layout_width="wrap_content" android:layout_height="wrap_content"></EditText>
</LinearLayout>
我希望你明白我的意思,因爲它不是很容易解釋這個奇怪的(愚蠢)的問題。謝謝。
您可以在[此鏈接]找到您的解決方案(http://stackoverflow.com/a/7962813/779408)。請享用! :) – breceivemail 2012-04-18 08:54:26