2

我正在尝试从 midi 文件中解析歌词并获取一些越南语字符,例如:ắ、ố、ê、...我如何在 textview 中显示这些字符。谢谢

我试过了,但没有工作

while(it.hasNext()) {
        MidiEvent E = it.next();

        if(E.getClass().equals(Lyrics.class)) {
            Lyrics lyric = (Lyrics)E;
            String a = "";
            try {
                a = new String(lyric.getLyric().getBytes("UTF8"), "UTF8");
            } catch (UnsupportedEncodingException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            mLyrics += a;
        }
    }

    TextView txtLyric = (TextView)findViewById(R.id.txtLyric1);

    txtLyric.setText(mLyrics);
4

1 回答 1

0

我认为您可以尝试encode输入数据,UTF-8然后将它们显示到textview

String original = "";

  try {
      byte[] converted = original.getBytes("UTF8");

  } catch (UnsupportedEncodingException e) {
      e.printStackTrace();
  }
于 2013-01-30T07:57:09.707 回答