From 5707528be0eb10d7498e9f2b4523ac9a11f92527 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 20 Mar 2017 17:25:46 +0100 Subject: [PATCH] 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 --- src/corelib/tools/qstring.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 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)