UTF-8 problem

The UTF8 filename displays perfectly with correct column alignment. I have a problem displaying multi-byte UTF8 strings from ID3v2 tags. I have a mp3 file with ID3 tag containing 0x ff-fe 73-96 55-59 c5-8f, but MOC displays it as 0x b7 b7 b7 instead of 0x e9-99-b3 e5-a5-95 e8-bf-85. I would appreciate any insight for getting this to work. I'm using MOC 2.4.1 in an en_US.UTF-8 locale.

It's compiled with
configure --build=i686-redhat-linux-gnu --host=i686-redhat-linux-gnu --target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --prefix=/var/tmp/moc-2.4.1-1-root --disable-debug

$ ldd `which mocp`
linux-gate.so.1 => (0x005ea000)
libasound.so.2 => /lib/libasound.so.2 (0x05221000)
libpthread.so.0 => /lib/libpthread.so.0 (0x0085c000)
libsamplerate.so.0 => /usr/lib/libsamplerate.so.0 (0x00810000)
libcurl.so.3 => /usr/lib/libcurl.so.3 (0x00558000)
libdl.so.2 => /lib/libdl.so.2 (0x0075b000)
libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x00219000)
libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x0016b000)
libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00d06000)
libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x00df7000)
libcom_err.so.2 => /lib/libcom_err.so.2 (0x00c17000)
libresolv.so.2 => /lib/libresolv.so.2 (0x00cdb000)
libidn.so.11 => /usr/lib/libidn.so.11 (0x00a92000)
libssl.so.5 => /lib/libssl.so.5 (0x001df000)
libcrypto.so.5 => /lib/libcrypto.so.5 (0x003fa000)
libz.so.1 => /usr/lib/libz.so.1 (0x00761000)
libncursesw.so.5 => /usr/lib/libncursesw.so.5 (0x00776000)
libm.so.6 => /lib/libm.so.6 (0x00734000)
libc.so.6 => /lib/libc.so.6 (0x00609000)
/lib/ld-linux.so.2 (0x005eb000)

Can you send me this file to daper at daper . net if it's under 2MB?
First few KB should be enouth, if it's too large for mail, try dd if=file.mp3 of=short.mp3 bs=1k count=128 if short.mp3 also works this way, please send me short.mp3.

--
Damian Pietras - MOC developer

Thanks for looking into it. The file has been sent by email as requested.

Please try the following patch:
<br /> Index: decoder_plugins/mp3/mp3.c<br /> ===================================================================<br /> --- decoder_plugins/mp3/mp3.c (revision 1982)<br /> +++ decoder_plugins/mp3/mp3.c (working copy)<br /> @@ -156,7 +156,7 @@</p> <p> /* Workaround for ID3 tags v1/v1.1 where the encoding<br /> * is latin1. */<br /> - if (id3_tag_options(tag, 0, 0) &amp; ID3_TAG_OPTION_ID3V1) {<br /> + if (0 &amp;& id3_tag_options(tag, 0, 0) &amp; ID3_TAG_OPTION_ID3V1) {<br /> char *t;</p> <p> comm = (char *)id3_ucs4_latin1duplicate (ucs4);<br />

Unfortunately I think it will break encoding for some files, so this is not a real solution.

--
Damian Pietras - MOC developer

Thanks for the patch. It works. Perhaps MOC can add support for the frame field_type to differentiate between ID3_FIELD_TYPE_LATIN1 and ID3_FIELD_TYPE_STRING.

I didn't think about this, but I'll take a deeper look at it. Thanks.

--
Damian Pietras - MOC developer

All my mp3 files have tags type set to ID3_FIELD_TYPE_STRINGLIST including your file, so this is not a solution.

--
Damian Pietras - MOC developer