QLocal8Bit::convertFromUnicode[win]: Drop UsedDefaultChar argument
We don't use the value, and the docs[0] say that we get the best performance if we don't pass the argument. [0] https://learn.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-widechartomultibyte#remarks See table Pick-to: 6.5 Task-number: QTBUG-118185 Task-number: QTBUG-105105 Change-Id: I3eb5e023a936fe3def5169e3fb492a62708bbf44 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 36a6522b48dd74305e1a57a520651f34f2d91ee4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
ac103de62b
commit
0e1aef15f0
@ -1395,14 +1395,14 @@ QByteArray QLocal8Bit::convertFromUnicode_sys(QStringView in, quint32 codePage,
|
||||
return QByteArray();
|
||||
if (uclen == 0)
|
||||
return QByteArray("");
|
||||
BOOL used_def;
|
||||
QByteArray mb(4096, 0);
|
||||
int len;
|
||||
while (!(len = WideCharToMultiByte(codePage, 0, ch, uclen, mb.data(), mb.size() - 1, 0,
|
||||
&used_def))) {
|
||||
while (!(len = WideCharToMultiByte(codePage, 0, ch, uclen, mb.data(), mb.size() - 1, nullptr,
|
||||
nullptr))) {
|
||||
int r = GetLastError();
|
||||
if (r == ERROR_INSUFFICIENT_BUFFER) {
|
||||
mb.resize(1+WideCharToMultiByte(codePage, 0, ch, uclen, 0, 0, 0, &used_def));
|
||||
mb.resize(1
|
||||
+ WideCharToMultiByte(codePage, 0, ch, uclen, nullptr, 0, nullptr, nullptr));
|
||||
// and try again...
|
||||
} else {
|
||||
// Fail. Probably can't happen in fact (dwFlags is 0).
|
||||
|
Loading…
x
Reference in New Issue
Block a user