From af7e756155cf44e05816cf91be04e13d9e7ca084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Tue, 18 Jul 2017 10:41:20 +0200 Subject: Return "en" for QLocale::c().bcp47Name() Currently QLocale::c().bcp47Name() returns "C" which, according to [BCP47], is not a valid language tag. In particular it does not conform to the ABNF grammar in section 2.1 which specifies a minimum length of 2 characters for all language tags. [BCP47]: https://tools.ietf.org/html/bcp47 This patch changes the return value to "en" seeing as the documentation for QLocale::Language states that the C language is identical in behavior to English. Task-number: QTBUG-61949 Change-Id: I2a381def8fb7156467e01d105da92bb1f4821204 Reviewed-by: Edward Welbourne --- tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/corelib/tools/qlocale/tst_qlocale.cpp') diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index d08e5dc289..10d78b1f2f 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -2529,7 +2529,7 @@ void tst_QLocale::textDirection() void tst_QLocale::bcp47Name() { - QCOMPARE(QLocale("C").bcp47Name(), QStringLiteral("C")); + QCOMPARE(QLocale("C").bcp47Name(), QStringLiteral("en")); QCOMPARE(QLocale("en").bcp47Name(), QStringLiteral("en")); QCOMPARE(QLocale("en_US").bcp47Name(), QStringLiteral("en")); QCOMPARE(QLocale("en_GB").bcp47Name(), QStringLiteral("en-GB")); -- cgit v1.2.3