Comment 2 for bug 223547

Revision history for this message
ChenXing (cxcxcxcx) wrote :

I am also suffering from this bug, and strongly suggest the patch provided by Jiahua Huang be adopted.

Most mp3 files(about 90%+ without exaggeration) in mainland China still have tags encoded in gb18030. So this is a critical bug affecting all Chinese users. We Chinese are trying hard to find music players supporting legacy encoding in Linux, but failed. This is even the most important reason why my friends say Linux has poor support on Chinese language.

Besides, Huang's patch doesn't affect well encoded UTF-8 tags, but will add support for legacy encodings. The patch also works for Exaile 0.2.99, by adding the code block into xl/metadata/_id3.py before "class ID3Format", like:

...
from mutagen import id3

_unicode=unicode
def unicode(string, encoding='utf8',errors='strict'):
    try:
        string = string.decode('utf8').encode('iso8859-1')
    except:
        return _unicode(string)
    for enc in ('utf8', 'gb2312', 'big5', 'gb18030', 'big5hkscs', 'euc-jp', 'euc_kr', 'cp1251', 'utf16'):
        try:
            return string.decode(enc)
        except:
            pass
    return string

class ID3Format(BaseFormat):
...