From bf0735a1b70ff1a6723a728cef32d3eb6ef96902 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Mon, 25 Apr 2016 06:44:05 +0000 Subject: fixed problem with non-latin characters in the file paths under windows (#852) git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6261 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Input/mad/decodermadfactory.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/plugins/Input/mad/decodermadfactory.cpp') diff --git a/src/plugins/Input/mad/decodermadfactory.cpp b/src/plugins/Input/mad/decodermadfactory.cpp index 826576773..3c1e68087 100644 --- a/src/plugins/Input/mad/decodermadfactory.cpp +++ b/src/plugins/Input/mad/decodermadfactory.cpp @@ -39,6 +39,12 @@ #include "decoder_mad.h" #include "decodermadfactory.h" +#ifdef Q_OS_WIN +#define QStringToFileName(s) TagLib::FileName(reinterpret_cast(s.utf16()) +#else +#define QStringToFileName(s) s.toLocal8Bit().constData() +#endif + // DecoderMADFactory DecoderMADFactory::DecoderMADFactory() @@ -128,7 +134,7 @@ QList DecoderMADFactory::createPlayList(const QString &fileName, boo TagLib::Tag *tag = 0; #if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) - TagLib::FileStream stream(fileName.toLocal8Bit().constData(), true); + TagLib::FileStream stream(QStringToFileName(fileName), true); TagLib::MPEG::File fileRef(&stream, TagLib::ID3v2::FrameFactory::instance()); #else TagLib::MPEG::File fileRef(fileName.toLocal8Bit ().constData()); -- cgit v1.2.3-13-gbd6f