Bug 40773 - russian mp3 tag info is in cp1251 while locale codec is KOI8-R
Summary: russian mp3 tag info is in cp1251 while locale codec is KOI8-R
Status: RESOLVED DUPLICATE of bug 48604
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Multimedia Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-11 20:48 UTC by stephan
Modified: 2003-12-11 02:32 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description stephan 2002-04-11 20:35:25 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           noatun
Version:           KDE 3.0.0 
Severity:          wishlist
Installed from:    Compiled From Sources
Compiler:          gcc 3.0.4
OS:                Linux
OS/Compiler notes: Not Specified

i think this patch to kdemultimedia-3.0/kfile-plugins/mp3/kfile_mp3.cpp  will solve the problem

34a35
> #include <qtextcodec.h>
178a180185
>
>         QString loc = QTextCodec::locale();
> 
>         if (loc == "ru")
>         {
>             QTextCodec *codec = QTextCodec::codecForName("CP 1251"); // get the codec for CP 1251
180184c187200
<         appendItem(id3group "Title" QString::fromLocal8Bit(mp3.id3.title));
<         appendItem(id3group "Artist" QString::fromLocal8Bit(mp3.id3.artist));
<         appendItem(id3group "Album" QString::fromLocal8Bit(mp3.id3.album));
<         appendItem(id3group "Date" QString::fromLocal8Bit(mp3.id3.year));
<         appendItem(id3group "Comment" QString::fromLocal8Bit(mp3.id3.comment));
---
>             appendItem(id3group "Title" codec->toUnicode(mp3.id3.title));
>             appendItem(id3group "Artist" codec->toUnicode(mp3.id3.artist));
>             appendItem(id3group "Album" codec->toUnicode(mp3.id3.album));
>             appendItem(id3group "Date" codec->toUnicode(mp3.id3.year));
>             appendItem(id3group "Comment" codec->toUnicode(mp3.id3.comment));
>         }
>         else
>         {
>             appendItem(id3group "Title" QString::fromLocal8Bit(mp3.id3.title));
>             appendItem(id3group "Artist" QString::fromLocal8Bit(mp3.id3.artist));
>             appendItem(id3group "Album" QString::fromLocal8Bit(mp3.id3.album));
>             appendItem(id3group "Date" QString::fromLocal8Bit(mp3.id3.year));
>             appendItem(id3group "Comment" QString::fromLocal8Bit(mp3.id3.comment));
>         }
257261c273292
<     strncpy(mp3.id3.title  info["id3v1.1"]["Title"]  .value().toString().local8Bit() 31);
<     strncpy(mp3.id3.artist info["id3v1.1"]["Artist"] .value().toString().local8Bit() 31);
<     strncpy(mp3.id3.album  info["id3v1.1"]["Album"]  .value().toString().local8Bit() 31);
<     strncpy(mp3.id3.year   info["id3v1.1"]["Date"]   .value().toString().local8Bit()  5);
<     strncpy(mp3.id3.commentinfo["id3v1.1"]["Comment"].value().toString().local8Bit() 29);
---
>     QString loc = QTextCodec::locale();
> 
>     if (loc == "ru")
>     {
>         QTextCodec *codec = QTextCodec::codecForName("CP 1251"); // get the codec for CP 1251
> 
>         strncpy(mp3.id3.title  codec->fromUnicode(info["id3v1.1"]["Title"]  .value().toString()) 31);
>         strncpy(mp3.id3.artist codec->fromUnicode(info["id3v1.1"]["Artist"] .value().toString()) 31);
>         strncpy(mp3.id3.album  codec->fromUnicode(info["id3v1.1"]["Album"]  .value().toString()) 31);
>         strncpy(mp3.id3.year   codec->fromUnicode(info["id3v1.1"]["Date"]   .value().toString())  5);
>         strncpy(mp3.id3.commentcodec->fromUnicode(info["id3v1.1"]["Comment"].value().toString()) 29);
>     }
>     else
>     {
>         strncpy(mp3.id3.title  info["id3v1.1"]["Title"]  .value().toString().local8Bit() 31);
>         strncpy(mp3.id3.artist info["id3v1.1"]["Artist"] .value().toString().local8Bit() 31);
>         strncpy(mp3.id3.album  info["id3v1.1"]["Album"]  .value().toString().local8Bit() 31);
>         strncpy(mp3.id3.year   info["id3v1.1"]["Date"]   .value().toString().local8Bit()  5);
>         strncpy(mp3.id3.commentinfo["id3v1.1"]["Comment"].value().toString().local8Bit() 29);
>     }


(Submitted via bugs.kde.org)
Comment 1 Charles Samuels 2002-09-20 20:45:50 UTC
Correct me if I'm wrong, but aren't ID3 tags supposed to be 
Latin-1? 
 
Perhaps try Vorbis, as they encode to utf8... 
 
Comment 2 Scott Wheeler 2003-12-11 02:32:01 UTC
Yes, ID3v1 is limited to ISO-8859-1.  However I've got a work around for this explained in the duplicate bug report.  Please read the note that I wrote there...

*** This bug has been marked as a duplicate of 48604 ***