Use qUtf8Printable() for logging strings

qDebug(), qInfo(), qWarning(), qCritical(), qFatal() expect %s arguments
to be UTF-8 encoded, while qPrintable() converts to local 8-bit encoding.
Therefore qUtf8Printable() should be used for logging strings instead of
qPrintable().
This commit is contained in:
Vladimir Golovnev (qlassez)
2017-08-13 13:56:03 +03:00
parent 219a6b3ad1
commit cff6a64e9f
28 changed files with 100 additions and 99 deletions

View File

@@ -135,7 +135,7 @@ void TorrentCreatorThread::run()
if (isInterruptionRequested()) return;
// create the torrent and print it to out
qDebug("Saving to %s", qPrintable(m_savePath));
qDebug("Saving to %s", qUtf8Printable(m_savePath));
#ifdef _MSC_VER
wchar_t *savePathW = new wchar_t[m_savePath.length() + 1];
int len = Utils::Fs::toNativePath(m_savePath).toWCharArray(savePathW);