how to select the encoding of the mp3 tag to read?

Anton Sergunov setosha at gmail.com
Tue Aug 31 03:27:50 CEST 2010


It's fun, but it doesn't worker for me.
80% of my songs with russian tag have ID3v2 tag with "Latin1"-strings.
Seems on windows I should read ALL Latin1 strings as Local encoded.

2010/8/30 Scott Wheeler <wheeler at kde.org>:
>
> On Aug 29, 2010, at 2:37 PM, Anton Sergunov wrote:
>
>>> I wonder if I could select the encoding of the mp3 tags I am to read.
>>> Many mp3 here use encoding gb18030 (Chinese).
>>
>> Encoding stored in ID3v2 tag. So you dont need to set it manual.
>> But ID3v1 all strings sould be stored in latin encoding. So old
>> programs stores tag in local encoding. You can't know encoding, but in
>> most cases old incorrected saved tags in local user encoding.
>>
>> My Qt solution:
>>
>> QString toQString(const TagLib::String& str)
>> {
>>  if(str.isLatin1())
>>    return QString::fromLocal8Bit(str.to8Bit().c_str());
>>  return QString::fromStdWString(str.toWString());
>> }
>
> The better way to do this is by subclassing ID3v1::StringHandler:
>
> http://developer.kde.org/~wheeler/taglib/api/classTagLib_1_1ID3v1_1_1StringHandler.html
>
> -Scott
>
> _______________________________________________
> taglib-devel mailing list
> taglib-devel at kde.org
> https://mail.kde.org/mailman/listinfo/taglib-devel
>


More information about the taglib-devel mailing list