From ed1846b94df1a50ffbac3a8cd82b102e5fe05ce9 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 25 Jan 2023 08:42:46 +0100 Subject: Fix encoding of prefix path in embedded :/qt/etc/qt.conf resource QString-type entries of QSettings are UTF-8 in Qt 6; do not use toLocal8Bit(), which uses the code page on Windows. Amends 4134ffd908144a5cf7c84333d2b2726c86ac8762. Pick-to: 6.4 6.2 Fixes: PYSIDE-2204 Task-number: PYSIDE-972 Change-Id: Id59019caa1e01a90bd8836db63c50e3b582c3ecf Reviewed-by: Adrian Herrmann Reviewed-by: Shyamnath Premnadh --- sources/pyside6/libpyside/pyside.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'sources/pyside6/libpyside/pyside.cpp') diff --git a/sources/pyside6/libpyside/pyside.cpp b/sources/pyside6/libpyside/pyside.cpp index 50d125a28..a60b7131a 100644 --- a/sources/pyside6/libpyside/pyside.cpp +++ b/sources/pyside6/libpyside/pyside.cpp @@ -873,13 +873,7 @@ bool registerInternalQtConf() #ifdef PYSIDE_QT_CONF_PREFIX setupPrefix = QStringLiteral(PYSIDE_QT_CONF_PREFIX); #endif - const QString prefixPathStr = pysideDir.absoluteFilePath(setupPrefix); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - const QByteArray prefixPath = prefixPathStr.toLocal8Bit(); -#else - // PYSIDE-972, QSettings used by QtCore uses Latin1 - const QByteArray prefixPath = prefixPathStr.toLatin1(); -#endif + const QByteArray prefixPath = pysideDir.absoluteFilePath(setupPrefix).toUtf8(); // rccData needs to be static, otherwise when it goes out of scope, the Qt resource system // will point to invalid memory. -- cgit v1.2.3