Japanese text in mp3 tags to musictracker

| 1 Comment

Since my friend Kacey gave me a nice J-Pop mp3 with some japanese text in the tag, I've been able to do some testing to see if these characters can get passed from the player into musictracker and hence to the status message....

jon@clairmont $ mid3v2 10\ 世界はこの手の中に.mp3
IDv2 tag info for 10 世界はこの手の中に.mp3:
TPE1=相川七瀬
APIC= (PNG, 105828 bytes)
TYER=2000
TIT2=世界はこの手の中に
TENC=iTunes v7.7.1
TRCK=10/13
TPOS=1/1
TALB=FOXTROT
TCON=Pop

This all seems to work swimmingly on various players under Linux, but under Windows it's more complex...

  • GetWindowText() on the foobar2000 window just returns a load of "?" characters, presumably because they don't exist in the local codepage (unlike accented characters like ö which survive this translation intact). Using GetWindowTextW() to retrieve the title in wide-character form then converting it to UTF-8 seems to work fine.
  • Winamp makes an utter hash of returning these characters via the (legacy) IPC_GET_EXTENDED_FILE_INFO interface we are using. Updating to use IPC_GET_EXTENDED_FILE_INFOW fixes this. We also need to use GetWindowTextW() as above for looking at the window title (which we use for stream information)
  • The mysterious wmp9.dll seems incapable of returning these correctly from Windows Media Player.... yet another reason to replace this code with something else....
  • This all works fine with iTunes, but it doesn't seem possible to actually display the song title correctly in iTunes, since it uses a fixed font (Lucida Grande?) which you can't seem to change and which doesn't have the glyphs. Later: turning on East Asian language support in Windows XP fixes this, presumably as it lets Windows do it's font linking thing to find the glyphs in another font...

So now I know more about this windows wide character nonsense than I ever wanted to. Oh, and I'm now one of the top listeners to Nanase Aikawa on last.fm :-)

1 Comment

Thanx a LOT!!!

I finally got WMP11 working. Been waiting for this for too long :D

Leave a comment

About this Entry

This page contains a single entry by Jon published on August 6, 2008 4:49 PM.

pidgin monotone crosscompile for win32 was the previous entry in this blog.

x86_64 crosscompilation is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.