Posts

Showing posts with the label chardet

I have reported the audacious-plugins' problem to upstream

http://bugs-meta.atheme.org/view.php?id=632 Here is the problem's description: In audacious-plugins' current implementation, when saving MP3's tags, unicode is enabled unconditionally. In save_cb() function in http://svn.atheme.org/audacious-plugins/trunk/src/mpg123/fileinfo.c, [ ^ ] there are two function calls: taglib_set_strings_unicode(1); and taglib_set_id3v2_default_text_encoding(); However, when reading MP3's tags, if chardet is enabled, unicode will be disabled. In fill_entries() function in the same file, there is a conditional compilation: #ifdef USE_CHARDET taglib_set_strings_unicode(FALSE); #endif This may not affect English only users. But for CJK users, this discrepancy of dealing with chardet will lead to MP3's title and artist being rendered as garbled characters.

解决audacious写入id3tag乱码问题的补丁

首先说一说我对chardet的理解: 如果启用chardet,那么让taglib把所有tag的encoding当做Latin1,然后audacious自己来进行编码侦测。 如果不启用chardet,让taglib把所有tag当UTF8。 相比较amarok,audacious确实给用户多了一种选择。用户可以不转码。转的不"规范"的UTF8编码(也就是只转码,没加encoding byte)的tag也可以显示。 可惜我之前不知道,我用id3v2转了很多mp3,都属于此类情况。 现在我准备向"标准"靠拢。我准备不再用audacious的chardet功能。 我改写了taglib里的例子,用它配合我的id3转码脚本,在结合下面这个网页上的脚本,来把我所有的mp3都转"正确"的编码。 http://paste.ubuntu.org.cn/1090 这样一来amarok里也可以正常显示。否则像现在这样amarok里所有的歌都是乱码,除非不含tag的,可以正确显示文件名。 虽然我不用chardet,不过这个补丁还是要贡献出来。它应该有理由被upstream收录。gentoo-china overlay用户可以直接layman -S后,emerge audacious-plugins http://gentoo-china-overlay.googlecode.com/svn/trunk/media-plugins/audacious-plugins/files/audacious-plugins-1.2.2-mp3-id3tag-edit.patch