我知道这是个老问题,但我对之前给出的答案不满意。我的问题是如何使用 UTF-8 或任何技术显示法语字母(如 é、à 等)。
目前这些正在显示“?”。
我的代码是:
InputStream is = null;
try {
if(CommonUtilities.prefs.getString("KEY_LOCALE", "fr").equalsIgnoreCase("fr")){
is = getAssets().open("terms_txt_fr.txt");
}else{
is = getAssets().open("terms_txt_en.txt");
}
String term_tx =convertStreamToString(is);
String valueUTF8 = new String(term_tx.getBytes(), "UTF-8");
terms_tx.setText(valueUTF8);
} catch (IOException e) {
e.printStackTrace();
}