From d5bb8d5150498dc059e8c17f224c66fb1a6bcf32 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 15 Jan 2020 13:14:20 +0100 Subject: Preserve the case of the exponent separator CLDR supplies We have long (since 4.5.1) coerced it to lower-case, for no readily apparent, much less documented, reason. CLDR says most locales use an upper-case E for this - let's actually use what CLDR says we should use. The code that matches the exponent separator was doing so case-insensitively in any case; that needed adaptation now that the separator's case isn't pre-determined; and, in any case, should have been done using case-folding rather than upper-casing. In the process, removed some spurious checks for "'e' or 'E'" in the result, since the exponent separator is always represented by 'e' (and an 'e' might also be present for the separate reason of its use as a beyond-decimal digit representing fourteen). [ChangeLog][QtCore][QLocale] QLocale::exponential() now preserves the case of the CLDR source, where previously it was lower-cased. Change-Id: Ic9ac02136cff79cb9f136d72141b5dbf54d9e0a6 Reviewed-by: Lars Knoll --- src/corelib/text/qlocale_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/text/qlocale_p.h') diff --git a/src/corelib/text/qlocale_p.h b/src/corelib/text/qlocale_p.h index bb24009523..938d7bbb6a 100644 --- a/src/corelib/text/qlocale_p.h +++ b/src/corelib/text/qlocale_p.h @@ -417,7 +417,7 @@ inline char QLocaleData::digitToCLocale(QChar in) const if (in == m_group) return ','; - if (in == m_exponential || in == QChar(QChar::toUpper(m_exponential))) + if (in == m_exponential || in.toCaseFolded().unicode() == QChar::toCaseFolded(m_exponential)) return 'e'; // In several languages group() is a non-breaking space (U+00A0) or its thin -- cgit v1.2.3