aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-04-26 13:11:18 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-04-27 20:49:11 +0200
commit7809a047416eacb6f245160aa018127f5b0e8e81 (patch)
tree4432b0f042c09f9b1ad2e6587c0c24a923e50003 /sources/pyside6
parent70ffe0b5136cfce75c94fa09cd6070b7270f684d (diff)
PySide6/Windows: Fix encoding of QCoreApplication.arguments()
Encode in the console's code page via wchar_t. Fixes: PYSIDE-1425 Change-Id: Ideae87361409a61919ea6bf8d5594609dceaa1cb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside6')
-rw-r--r--sources/pyside6/tests/QtCore/CMakeLists.txt1
-rw-r--r--sources/pyside6/tests/QtCore/qcoreapplication_argv_test.py50
2 files changed, 51 insertions, 0 deletions
diff --git a/sources/pyside6/tests/QtCore/CMakeLists.txt b/sources/pyside6/tests/QtCore/CMakeLists.txt
index bc3d28a7d..e9717d9d0 100644
--- a/sources/pyside6/tests/QtCore/CMakeLists.txt
+++ b/sources/pyside6/tests/QtCore/CMakeLists.txt
@@ -56,6 +56,7 @@ PYSIDE_TEST(qcalendar_test.py)
PYSIDE_TEST(qcbor_test.py)
PYSIDE_TEST(qcollator_test.py)
PYSIDE_TEST(qcommandlineparser_test.py)
+PYSIDE_TEST(qcoreapplication_argv_test.py)
PYSIDE_TEST(qcoreapplication_instance_test.py)
PYSIDE_TEST(qcoreapplication_test.py)
PYSIDE_TEST(qdatastream_test.py)
diff --git a/sources/pyside6/tests/QtCore/qcoreapplication_argv_test.py b/sources/pyside6/tests/QtCore/qcoreapplication_argv_test.py
new file mode 100644
index 000000000..e013fdb71
--- /dev/null
+++ b/sources/pyside6/tests/QtCore/qcoreapplication_argv_test.py
@@ -0,0 +1,50 @@
+#############################################################################
+##
+## Copyright (C) 2021 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the test suite of Qt for Python.
+##
+## $QT_BEGIN_LICENSE:GPL-EXCEPT$
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see https://www.qt.io/terms-conditions. For further
+## information use the contact form at https://www.qt.io/contact-us.
+##
+## GNU General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 3 as published by the Free Software
+## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+## included in the packaging of this file. Please review the following
+## information to ensure the GNU General Public License requirements will
+## be met: https://www.gnu.org/licenses/gpl-3.0.html.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+import os
+import sys
+import unittest
+
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+from init_paths import init_test_paths
+init_test_paths(False)
+
+from PySide6.QtCore import QCoreApplication
+
+
+class TestQCoreApplication(unittest.TestCase):
+ def testConsoleEncoding(self):
+ """PYSIDE-1425, console encoding on Windows."""
+ arg0 = "Üllrich Ümläut"
+ app = QCoreApplication([arg0])
+ self.assertEqual(app.arguments()[0], arg0)
+
+
+if __name__ == '__main__':
+ unittest.main()