Logging: fix encoding of backtrace lines

File and function names are UTF-8 on Unix.

Pick-to: 6.2 6.3
Change-Id: Ic15405335d804bdea761fffd16d4fb71ec2b0d71
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Thiago Macieira 2022-02-18 12:30:30 -08:00
parent d589f3eefe
commit 50132fb54b

View File

@ -1297,7 +1297,7 @@ static QStringList backtraceFramesForLogMessage(int frameCount)
int numberPrinted = 0;
for (int i = 0; i < n && numberPrinted < frameCount; ++i) {
QScopedPointer<char*, QScopedPointerPodDeleter> strings(backtrace_symbols(buffer.data() + i, 1));
QString trace = QString::fromLatin1(strings.data()[0]);
QString trace = QString::fromUtf8(strings.data()[0]);
QRegularExpressionMatch m = rx.match(trace);
if (m.hasMatch()) {
QString library = m.captured(1);