Отображение латинских символов - PullRequest
0 голосов
/ 04 ноября 2018

Я читаю файл из папки и файл на латинице. когда я пытаюсь прочитать какой-нибудь символ ? , как мне отобразить символы? Я пробую много решений, которые не работают для меня. Так что кто-нибудь знает это.

это я уже сделал.

 void ReadFile() {
    File fileDirectory = new File(Environment.getExternalStorageDirectory()
            + "/Offline Lyric/");
    // lists all the files into an array
    //read file text
    File file = new File(fileDirectory, String.valueOf(songnamestring));

    //Read text from file
    StringBuilder text = new StringBuilder();

    try {
        //BufferedReader br = new BufferedReader(new FileReader(file));
        BufferedReader br = new BufferedReader(new FileReader(file));

        String line;

        while ((line = br.readLine()) != null) {
            text.append(line);
            text.append('\n');
        }
        br.close();
    } catch (IOException e) {
        e.printStackTrace();
    }

    //Find the view by its id
    //Set the text
    try {
        songlyric.setText("" + new String(text.toString().getBytes("ISO-8859-1"), "UTF-8"));
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    }

    //set type face
    caveat = Typeface.createFromAsset(LyricActivity.this.getAssets(), "caveat-regular.ttf");
    bellotaltilc = Typeface.createFromAsset(LyricActivity.this.getAssets(), "BellotaItalic.ttf");

    songlyric.setTypeface(bellotaltilc);
}

Заранее спасибо

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...