From e891543f42ae1d5d64716ea5c056bd960518a125 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Wed, 2 Jun 2010 13:22:54 +0000 Subject: [PATCH] Fix the encoding of composers and albumartists as well --- src/core/song.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/song.cpp b/src/core/song.cpp index bbebb2c6c..b400b5781 100644 --- a/src/core/song.cpp +++ b/src/core/song.cpp @@ -274,10 +274,10 @@ void Song::InitFromFile(const QString& filename, int directory_id) { d->bpm_ = TStringToQString(file->ID3v2Tag()->frameListMap()["TBPM"].front()->toString()).trimmed().toFloat(); if (!file->ID3v2Tag()->frameListMap()["TCOM"].isEmpty()) - d->composer_ = TStringToQString(file->ID3v2Tag()->frameListMap()["TCOM"].front()->toString()).trimmed(); + d->composer_ = UniversalEncodingHandler::FixEncoding(file->ID3v2Tag()->frameListMap()["TCOM"].front()->toString()); if (!file->ID3v2Tag()->frameListMap()["TPE2"].isEmpty()) // non-standard: Apple, Microsoft - d->albumartist_ = TStringToQString(file->ID3v2Tag()->frameListMap()["TPE2"].front()->toString()).trimmed(); + d->albumartist_ = UniversalEncodingHandler::FixEncoding(file->ID3v2Tag()->frameListMap()["TPE2"].front()->toString()); if (!file->ID3v2Tag()->frameListMap()["TCMP"].isEmpty()) compilation = TStringToQString(file->ID3v2Tag()->frameListMap()["TCMP"].front()->toString()).trimmed(); @@ -286,7 +286,7 @@ void Song::InitFromFile(const QString& filename, int directory_id) { else if (TagLib::Ogg::Vorbis::File* file = dynamic_cast(fileref->file())) { if (file->tag()) { if ( !file->tag()->fieldListMap()["COMPOSER"].isEmpty() ) - d->composer_ = TStringToQString(file->tag()->fieldListMap()["COMPOSER"].front()).trimmed(); + d->composer_ = UniversalEncodingHandler::FixEncoding(file->tag()->fieldListMap()["COMPOSER"].front()); if ( !file->tag()->fieldListMap()["BPM"].isEmpty() ) d->bpm_ = TStringToQString(file->tag()->fieldListMap()["BPM"].front()).trimmed().toFloat(); @@ -301,7 +301,7 @@ void Song::InitFromFile(const QString& filename, int directory_id) { else if (TagLib::FLAC::File* file = dynamic_cast(fileref->file())) { if ( file->xiphComment() ) { if (!file->xiphComment()->fieldListMap()["COMPOSER"].isEmpty()) - d->composer_ = TStringToQString( file->xiphComment()->fieldListMap()["COMPOSER"].front() ).trimmed(); + d->composer_ = UniversalEncodingHandler::FixEncoding( file->xiphComment()->fieldListMap()["COMPOSER"].front() ); if (!file->xiphComment()->fieldListMap()["BPM"].isEmpty() ) d->bpm_ = TStringToQString( file->xiphComment()->fieldListMap()["BPM"].front() ).trimmed().toFloat();