diff options
author | hjk <hjk@qt.io> | 2017-03-20 17:25:46 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2017-03-21 06:37:12 +0000 |
commit | 5707528be0eb10d7498e9f2b4523ac9a11f92527 (patch) | |
tree | 6935946a23f27163bfc23254c6098fc0b0e45af2 | |
parent | 8a3e8856e5606ec616d4420ff8c4f77969432390 (diff) |
Use fromUtf8() instead of fromLatin1() for QT_RESTRICTED_CAST_FROM_ASCII
The change does not change legally observable behavior as the result
of using QT_RESTRICTED_CAST_FROM_ASCII is only defined for (a part of)
the 7-bit range where Latin1 and UTF-8 are the same.
This change does not intend to lift the 7-bit restriction on string
literals for which the use of QT_RESTRICTED_CAST_FROM_ASCII is
well-defined even though in practice it works now for any UTF-8,
which is the presumed encoding outside that range nowadays.
Change-Id: If9a4199235396a43f8f26d7591907b21120823ef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | src/corelib/tools/qstring.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 258034031c..8a7f4ff324 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -677,7 +677,7 @@ public: {} template <int N> inline QString &operator=(const char (&ch)[N]) - { return (*this = fromLatin1(ch, N - 1)); } + { return (*this = fromUtf8(ch, N - 1)); } #endif #if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII) inline QT_ASCII_CAST_WARN QString(const char *ch) |