From fdeb24a196edd6b8477242f65f26faae7368d730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Fri, 20 Dec 2019 23:39:20 +0100 Subject: [PATCH] Properly load non-ASCII map names --- src/map/IMG/img.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/map/IMG/img.cpp b/src/map/IMG/img.cpp index c34812e6..7ffc4f38 100644 --- a/src/map/IMG/img.cpp +++ b/src/map/IMG/img.cpp @@ -50,8 +50,9 @@ IMG::IMG(const QString &fileName) CHECK(_file.seek(0x49) && read(d1, sizeof(d1)) && _file.seek(0x61) && readValue(e1) && readValue(e2) && _file.seek(0x65) && read(d2, sizeof(d2))); + QByteArray nba(QByteArray(d1, sizeof(d1)) + QByteArray(d2, sizeof(d2))); - _name = QString(nba).trimmed(); + _name = QString::fromLatin1(nba.constData(), nba.size()-1).trimmed(); _blockSize = 1 << (e1 + e2); _blockCache.setMaxCost(CACHE_SIZE / _blockSize);