TagReaderTagLib: Use QString for converting TagLib::String

Converting directly to std::string does not seem to work correctly.
This commit is contained in:
Jonas Kvinge 2024-07-09 15:56:07 +02:00
parent 0de87b3e1e
commit 9232ad0125
1 changed files with 3 additions and 5 deletions

View File

@ -23,8 +23,6 @@
#include <string>
#include <boost/algorithm/string/trim.hpp>
#include <QByteArray>
#include <QString>
@ -77,9 +75,9 @@ class TagReaderTagLib : public TagReaderBase {
static inline void AssignTagLibStringToStdString(const TagLib::String &tstr, std::string *output) {
std::string stdstr = TagLibStringToStdString(tstr);
boost::trim(stdstr);
output->assign(stdstr);
const QString qstr = TagLibStringToQString(tstr).trimmed();
const QByteArray data = qstr.toUtf8();
output->assign(data.constData(), data.size());
}