diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-03-16 16:02:56 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-06-11 23:30:09 +0200 |
commit | 421c69fde579baf21cb0fd607a7cfd97e6e63220 (patch) | |
tree | 80cdc8b3735e91dcef86fcc83ab3545945d61989 /tests | |
parent | 81fbcc4dc6e71981d50a117ae4264c92c973905b (diff) |
Add .UTF-8 suffixes to locale-names passed to setlocale()
We use UTF-8 locales by default since Qt 6; and relatively few systems
have the encoding-unspecified locales we were trying to use, with the
result that the setlocale() calls all failed.
Task-number: COIN-689
Change-Id: Id791ba269bf4abac29da3daa4fd01684ca9caa7a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/text/qlocale/tst_qlocale.cpp | 6 | ||||
-rw-r--r-- | tests/auto/corelib/text/qstring/tst_qstring.cpp | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp index 32b47dbe01..986bc1e25e 100644 --- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp @@ -922,7 +922,7 @@ void tst_QLocale::stringToDouble() { // Make sure result is independent of locale: - TransientLocale ignoreme(LC_ALL, "ar_SA"); + TransientLocale ignoreme(LC_ALL, "ar_SA.UTF-8"); QCOMPARE(locale.toDouble(num_str, &ok), d); QCOMPARE(ok, good); } @@ -1009,7 +1009,7 @@ void tst_QLocale::stringToFloat() { // Make sure result is independent of locale: - TransientLocale ignoreme(LC_ALL, "ar_SA"); + TransientLocale ignoreme(LC_ALL, "ar_SA.UTF-8"); QCOMPARE(locale.toFloat(num_str, &ok), f); QCOMPARE(ok, good); } @@ -1180,7 +1180,7 @@ void tst_QLocale::doubleToString() const QLocale locale(localeName); QCOMPARE(locale.toString(num, mode, precision), numStr); - TransientLocale ignoreme(LC_ALL, "de_DE"); + TransientLocale ignoreme(LC_ALL, "de_DE.UTF-8"); QCOMPARE(locale.toString(num, mode, precision), numStr); } diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp index 5b5367abcd..8329948ef1 100644 --- a/tests/auto/corelib/text/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp @@ -5630,6 +5630,7 @@ void tst_QString::localeAwareCompare() QFETCH(QString, s1); QFETCH(QString, s2); QFETCH(int, result); + locale += QStringLiteral(".UTF-8"); // So we don't have to repeat it on every data row ! if (!locale.isEmpty()) { #if defined (Q_OS_DARWIN) || QT_CONFIG(icu) |