poti bug 22958, attachment 17786 - encoding in unsynchronizedlyricsframe.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: taglib/taglib/mpeg/id3v2/frames/unsynchronizedlyricsframe.cpp | |
=================================================================== | |
--- taglib/taglib/mpeg/id3v2/frames/unsynchronizedlyricsframe.cpp (revision 11368) | |
+++ taglib/taglib/mpeg/id3v2/frames/unsynchronizedlyricsframe.cpp (working copy) | |
@@ -23,16 +23,17 @@ | |
* Alternatively, this file is available under the Mozilla Public * | |
* License Version 1.1. You may obtain a copy of the License at * | |
* http://www.mozilla.org/MPL/ * | |
***************************************************************************/ | |
#include "unsynchronizedlyricsframe.h" | |
#include <tbytevectorlist.h> | |
#include <tdebug.h> | |
+#include <tstringlist.h> | |
using namespace TagLib; | |
using namespace ID3v2; | |
class UnsynchronizedLyricsFrame::UnsynchronizedLyricsFramePrivate | |
{ | |
public: | |
UnsynchronizedLyricsFramePrivate() : textEncoding(String::Latin1) {} | |
@@ -136,21 +137,26 @@ void UnsynchronizedLyricsFrame::parseFie | |
d->text = String(l.back(), d->textEncoding); | |
} | |
} | |
ByteVector UnsynchronizedLyricsFrame::renderFields() const | |
{ | |
ByteVector v; | |
- v.append(char(d->textEncoding)); | |
+ String::Type encoding = d->textEncoding; | |
+ | |
+ encoding = checkEncoding(d->description, encoding); | |
+ encoding = checkEncoding(d->text, encoding); | |
+ | |
+ v.append(char(encoding)); | |
v.append(d->language.size() == 3 ? d->language : "XXX"); | |
- v.append(d->description.data(d->textEncoding)); | |
- v.append(textDelimiter(d->textEncoding)); | |
- v.append(d->text.data(d->textEncoding)); | |
+ v.append(d->description.data(encoding)); | |
+ v.append(textDelimiter(encoding)); | |
+ v.append(d->text.data(encoding)); | |
return v; | |
} | |
//////////////////////////////////////////////////////////////////////////////// | |
// private members | |
//////////////////////////////////////////////////////////////////////////////// | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment