Click here to Skip to main content
11,632,172 members (76,973 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: Android Application
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
Edited 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 at 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 at 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 at 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 at 3-Feb-13 20:49pm
I think this is problem of android midi lib
Darren_vms at 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
0 OriginalGriff 8,498
1 Sergey Alexandrovich Kryukov 8,149
2 Mika Wendelius 6,260
3 F-ES Sitecore 2,321
4 Suvendu Shekhar Giri 1,995

Advertise | Privacy | Mobile
Web04 | 2.8.150728.1 | Last Updated 3 Feb 2013
Copyright © CodeProject, 1999-2015
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