TextView Android:无法识别特殊字符

时间:2015-06-14 17:39:23

标签: android

我在手机的特定文件夹中阅读了一个txt文档;这是阅读文档的代码:

public String read_file(String curFileName, String curFilePath) {

        File file = new File(curFilePath,curFileName);

        StringBuilder text = new StringBuilder();
        try {


            BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file), Charset.forName("UTF-8")));
                    String line;
            while ((line = br.readLine()) != null) {
                text.append(line+"\n");
            }
            br.close();
        }
        catch (IOException e) {
            //
        }

        TextView tv = (TextView)findViewById(R.id.dir);
        tv.setMovementMethod(new ScrollingMovementMethod());
        tv.setText(text);
        return text.toString();
    }

但是在textView中,诸如“和其他”之类的特殊字符无法识别。这是图像:

http://postimg.org/image/j6sfzt4sh/

0 个答案:

没有答案