Warning, /graphics/krita/3rdparty/ext_qt/0119-Fix-relocated-Qt-to-be-found-when-its-path-has-non-A.patch is written in an unsupported language. File is not indexed.
0001 From c1c9fb29d2eaf4c7aff4b3fb695c6366d2d5ecb6 Mon Sep 17 00:00:00 2001 0002 From: Alexandru Croitor <alexandru.croitor@qt.io> 0003 Date: Thu, 22 Apr 2021 09:07:46 +0300 0004 Subject: [PATCH 36/47] Fix relocated Qt to be found when its path has 0005 non-ASCII characters 0006 0007 The path returned by dladdr seems to be encoded with the current 0008 locale encoding which means that if it contains unicode characters, the 0009 fromLatin1() call mangles the path, and QFile::exists reports that 0010 the path does not exist. 0011 0012 To preserve non-ASCII characters use fromLocal8Bit() instead. 0013 0014 This should fix the runtime issue of finding the Qt prefix when the 0015 Qt library path has non-ASCII characters. 0016 0017 Amends 2f52afda8e77429c00029f94e887ed37dfb4e584. 0018 Amends 4ac872639ed0dd3ae6627e05bdda821f7d128500. 0019 0020 Fixes: QTBUG-84272 0021 Task-number: QTBUG-15234 0022 Change-Id: I37019ed219cf2cf7d9663cb1e16acdb97b3bdf09 0023 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> 0024 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> 0025 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> 0026 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> 0027 (cherry picked from commit 19b6ae6637bde73ec508b6d1d29f3233e2c4e2d4) 0028 --- 0029 src/corelib/global/qlibraryinfo.cpp | 2 +- 0030 1 file changed, 1 insertion(+), 1 deletion(-) 0031 0032 diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp 0033 index 9da9039f1a..9e9a8866f6 100644 0034 --- a/src/corelib/global/qlibraryinfo.cpp 0035 +++ b/src/corelib/global/qlibraryinfo.cpp 0036 @@ -554,7 +554,7 @@ static QString getRelocatablePrefix() 0037 Dl_info info; 0038 int result = dladdr(reinterpret_cast<void *>(&QLibraryInfo::isDebugBuild), &info); 0039 if (result > 0 && info.dli_fname) 0040 - prefixPath = prefixFromQtCoreLibraryHelper(QString::fromLatin1(info.dli_fname)); 0041 + prefixPath = prefixFromQtCoreLibraryHelper(QString::fromLocal8Bit(info.dli_fname)); 0042 #elif defined(Q_OS_WIN) 0043 HMODULE hModule = getWindowsModuleHandle(); 0044 const int kBufferSize = 4096; 0045 -- 0046 2.20.1.windows.1 0047