如何解决元音的口音问题 [英] How to fix vowel accent issue
问题描述
我要显示一个EditText区域在Android中的文本。
I must show a text in an EditText area in Android.
一切工作正常,但如果文本使用有重音元音字符,
All works fine, but if the text uses vowel chars that have accent,
例如:
E,I,A,OU
,
一个code所示,不正确的字符。
a code is shown, not the right character.
我只是用
String text= myEditText.getText().toString();
要获取字符串,我字符串存储在一个文件,并使用
to get the String, I store the string in a file and use
myEditText.setText(text);
以设置的EditText区字符串文本时,我在第二时刻检索数据。
to set the String text in the EditText area when I retrieve the data in a second moment.
推荐答案
我认为这个问题是将数据保存到文件中。如果在保存数据文件并不需要一个utf8字符集,那么你读回没有这些字符。因此,要确保你正确的储存:
I think the problem is during saving data to the file. If your file doesn't take a utf8 character set when you save your data, then you read it back without those characters. Therefore make sure you save it correctly:
String filePath = "/sdcard/utf8_file.txt";
String UTF8 = "utf8";
int BUFFER_SIZE = 8192;
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(filePath), UTF8),BUFFER_SIZE);
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filePath), UTF8),BUFFER_SIZE);
当你读回,那么你应该能够因为你现在做你的myEditText使用的setText()。
When you read it back, then you should be able to use setText() on your myEditText as you do now.
这篇关于如何解决元音的口音问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!