diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/soundsourcem4a/soundsourcem4a.cpp | 12 | ||||
-rw-r--r-- | plugins/soundsourcewv/soundsourcewv.cpp | 16 |
2 files changed, 3 insertions, 25 deletions
diff --git a/plugins/soundsourcem4a/soundsourcem4a.cpp b/plugins/soundsourcem4a/soundsourcem4a.cpp index 08d77a95b5..0fa58c3264 100644 --- a/plugins/soundsourcem4a/soundsourcem4a.cpp +++ b/plugins/soundsourcem4a/soundsourcem4a.cpp @@ -70,12 +70,7 @@ int SoundSourceM4A::initializeDecoder() { // Copy QString to char[] buffer for mp4_open to read from later QByteArray qbaFileName; -#ifdef Q_OS_WIN32 - // fopen() doesn't do utf8 on windows qbaFileName = m_qFilename.toLocal8Bit(); -#else - qbaFileName = m_qFilename.toUtf8(); -#endif int bytes = qbaFileName.length() + 1; ipd.filename = new char[bytes]; strncpy(ipd.filename, qbaFileName.constData(), bytes); @@ -182,13 +177,8 @@ inline long unsigned SoundSourceM4A::length(){ int SoundSourceM4A::parseHeader(){ setType("m4a"); - -#ifdef __WINDOWS__ - // fopen() doesn't do utf8 on windows + TagLib::MP4::File f(getFilename().toLocal8Bit().constData()); -#else - TagLib::MP4::File f(getFilename().toUtf8().constData()); -#endif bool result = processTaglibFile(f); TagLib::MP4::Tag* tag = f.tag(); diff --git a/plugins/soundsourcewv/soundsourcewv.cpp b/plugins/soundsourcewv/soundsourcewv.cpp index ca4defe9b6..5f473c8064 100644 --- a/plugins/soundsourcewv/soundsourcewv.cpp +++ b/plugins/soundsourcewv/soundsourcewv.cpp @@ -35,10 +35,10 @@ QList<QString> SoundSourceWV::supportedFileExtensions() int SoundSourceWV::open() { - QByteArray qBAFilename = m_qFilename.toUtf8(); + QByteArray qBAFilename = m_qFilename.toLocal8Bit(); char msg[80]; //hold posible error message - filewvc = WavpackOpenFileInput(qBAFilename.data(),msg,OPEN_2CH_MAX | OPEN_WVC,0); + filewvc = WavpackOpenFileInput(qBAFilename.constData(), msg,OPEN_2CH_MAX | OPEN_WVC,0); if (!filewvc) { qDebug() << "SSWV::open: failed to open file : "<<msg; return ERR; @@ -123,19 +123,7 @@ inline long unsigned SoundSourceWV::length(){ int SoundSourceWV::parseHeader() { setType("wv"); -#ifdef __WINDOWS__ - /* From Tobias: A Utf-8 string did not work on my Windows XP (German edition) - * If you try this conversion, f.isValid() will return false in many cases - * and processTaglibFile() will fail - * - * The method toLocal8Bit() returns the local 8-bit representation of the string as a QByteArray. - * The returned byte array is undefined if the string contains characters not supported - * by the local 8-bit encoding. - */ QByteArray qBAFilename = m_qFilename.toLocal8Bit(); -#else - QByteArray qBAFilename = m_qFilename.toUtf8(); -#endif TagLib::WavPack::File f(qBAFilename.constData()); // Takes care of all the default metadata |