From 186692f81f2612c3cf3a4090cbf949f2fb1558f8 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Mon, 30 Jan 2012 14:23:22 +0200 Subject: Remove custom text codec for C strings. This setting is extremely harmful, as code cannot know whether or not to expect it. It also made the behaviour of QString::fromAscii and ::toAscii unintuitive, and caused a lot of people to make mistakes with it. Change-Id: I2f429fa7ef93bd75bb93a7f64c56db15b7283388 Reviewed-by: Thiago Macieira Reviewed-by: Lars Knoll --- src/corelib/kernel/qvariant.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/corelib/kernel') diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 4e7fd94141..9f57cd018c 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -1162,8 +1162,8 @@ QVariant::QVariant(QDataStream &s) \fn QVariant::QVariant(const char *val) Constructs a new variant with a string value of \a val. - The variant creates a deep copy of \a val, using the encoding - set by QTextCodec::setCodecForCStrings(). + The variant creates a deep copy of \a val into a QString assuming + UTF-8 encoding on the input \a val. Note that \a val is converted to a QString for storing in the variant and QVariant::type() will return QMetaType::QString for @@ -1171,8 +1171,6 @@ QVariant::QVariant(QDataStream &s) You can disable this operator by defining \c QT_NO_CAST_FROM_ASCII when you compile your applications. - - \sa QTextCodec::setCodecForCStrings() */ #ifndef QT_NO_CAST_FROM_ASCII -- cgit v1.2.3