Click here to Skip to main content
13,196,126 members (53,847 online)
Rate this:
Please Sign up or sign in to vote.
I'm trying to parser lyric from midi file and get some Vietnamese character such as: ắ, ố, ê,...How do i display these character in textview. Thanks
(I use android midi lib to parser lyric of midi song[^])

This is my code

while(it.hasNext()) {
        MidiEvent E =;
        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
            mLyrics += a;
    TextView txtLyric = (TextView)findViewById(;
Posted 29-Jan-13 22:34pm
Updated 3-Feb-13 14:51pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Are you working in the emulator, because it has had problems in the past with some character codes.

Does it work when using a phone/tablet ?

What does get displayed ? Does it look like [] ?

What version of Android are you looking to deploy too ?

Whilst old you should look at Emulator issues[^] this has code attached ( which you could quickly try on different API versions.

DuHuynh 3-Feb-13 9:14am
I had try on my HTC Desire HD but get same problem. I develop with android v 4.0.3
These are images of problem
Darren_vms 3-Feb-13 14:35pm
I'm unable to see the images the site times out, did you try PinyinTest I pointed out on the link above ?
DuHuynh 3-Feb-13 20:34pm
Yes, i had try. I don't think this is problem of API version, because when i use TextView.SetText("Vietnamese character") it display fine as you see in images i attached.
I had checked image link, it still work fine
DuHuynh 3-Feb-13 20:49pm
I think this is problem of android midi lib
Darren_vms 6-Feb-13 6:09am
I noticed you added a few bugs to this, perhaps the problem lies in or

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.171019.1 | Last Updated 3 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100