diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2020-07-26 22:30:50 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2020-07-27 13:39:38 -0700 |
commit | a77c159044ce54fbdabaef088290771143ca5c2c (patch) | |
tree | 7368125b0135c458ce1479a18a7a94b4d119dae6 /src/plugins | |
parent | 188501fe27899cdc6a1aacf0d8c1a11144bd564a (diff) |
QWindowsServices: ungarble the URL
QUrl::toString always encodes as UTF-8, regardless of what the local
encoding is. So this produces garbage on Windows (and any non-UTF-8
system, but those don't exist any more outside of Windows, by
definition). So use %ls to keep the UTF-16.
Task-number: QTBUG-85745
Pick-to: 5.15
Change-Id: Iea47e0f8fc8b40378df7fffd162584f98e5bd633
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsservices.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/platforms/windows/qwindowsservices.cpp b/src/plugins/platforms/windows/qwindowsservices.cpp index 6a2708ee26..09ae55cd99 100644 --- a/src/plugins/platforms/windows/qwindowsservices.cpp +++ b/src/plugins/platforms/windows/qwindowsservices.cpp @@ -65,7 +65,7 @@ static inline bool shellExecute(const QUrl &url) nullptr, nullptr, SW_SHOWNORMAL)); // ShellExecute returns a value greater than 32 if successful if (result <= 32) { - qWarning("ShellExecute '%s' failed (error %s).", qPrintable(url.toString()), qPrintable(QString::number(result))); + qWarning("ShellExecute '%ls' failed (error %zu).", qUtf16Printable(url.toString()), result); return false; } return true; @@ -104,7 +104,7 @@ static inline bool launchMail(const QUrl &url) { QString command = mailCommand(); if (command.isEmpty()) { - qWarning("Cannot launch '%s': There is no mail program installed.", qPrintable(url.toString())); + qWarning("Cannot launch '%ls': There is no mail program installed.", qUtf16Printable(url.toString())); return false; } //Make sure the path for the process is in quotes @@ -129,7 +129,7 @@ static inline bool launchMail(const QUrl &url) si.cb = sizeof(si); if (!CreateProcess(nullptr, reinterpret_cast<wchar_t *>(const_cast<ushort *>(command.utf16())), nullptr, nullptr, FALSE, 0, nullptr, nullptr, &si, &pi)) { - qErrnoWarning("Unable to launch '%s'", qPrintable(command)); + qErrnoWarning("Unable to launch '%ls'", qUtf16Printable(command)); return false; } CloseHandle(pi.hProcess); |