From f6b1c875d944b0917c332a25449dfdfb571c277b Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 28 Oct 2022 16:07:12 +0200 Subject: [PATCH] Remove some factually inaccurate notes from QLocale method docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three methods parsing strings as numbers claimed not to fall back on the C locale. In fact, the parsing is somewhat lenient and has long accepted the digits and signs of the C locale's representations, along with the U+2212 minus sign, regardless of locale. The phrasing also tacitly suggested the matching QString function did fall back to C locale; when, in fact, it (since 6.0) *exclusively* uses the C locale. So that was misleading, too. Change-Id: Ida3f2f23b834ced5150bea20d8716756afd48e91 Reviewed-by: André Hartmann Reviewed-by: Thiago Macieira --- src/corelib/text/qlocale.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index 84956e2466c..031ba74fac0 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -1720,9 +1720,6 @@ QString QLocale::scriptToString(QLocale::Script script) If \a ok is not \nullptr, failure is reported by setting *\a{ok} to \c false, and success by setting *\a{ok} to \c true. - This function does not fall back to the 'C' locale if the string - cannot be interpreted in this locale. - This function ignores leading and trailing whitespace. \sa toDouble(), toInt(), toString() @@ -1738,9 +1735,6 @@ QString QLocale::scriptToString(QLocale::Script script) If \a ok is not \nullptr, failure is reported by setting *\a{ok} to \c false, and success by setting *\a{ok} to \c true. - This function does not fall back to the 'C' locale if the string - cannot be interpreted in this locale. - \snippet code/src_corelib_text_qlocale.cpp 3 Notice that the last conversion returns 1234.0, because '.' is the @@ -1942,10 +1936,6 @@ float QLocale::toFloat(QStringView s, bool *ok) const If \a ok is not \nullptr, failure is reported by setting *\a{ok} to \c false, and success by setting *\a{ok} to \c true. - Unlike QString::toDouble(), this function does not fall back to - the "C" locale if the string cannot be interpreted in this - locale. - \snippet code/src_corelib_text_qlocale.cpp 3-qstringview Notice that the last conversion returns 1234.0, because '.' is the