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/tools/qstringbuilder.h | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/corelib/tools/qstringbuilder.h') diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h index 5a4c27d22a..ebaaaa35c2 100644 --- a/src/corelib/tools/qstringbuilder.h +++ b/src/corelib/tools/qstringbuilder.h @@ -65,22 +65,12 @@ protected: static void convertToAscii(const QChar *a, int len, char *&out); static inline void convertFromAscii(char a, QChar *&out) { -#ifndef QT_NO_TEXTCODEC - if (QString::codecForCStrings) - *out++ = QChar::fromAscii(a); - else -#endif - *out++ = QLatin1Char(a); + *out++ = QLatin1Char(a); } static inline void convertToAscii(QChar a, char *&out) { -#ifndef QT_NO_TEXTCODEC - if (QString::codecForCStrings) - *out++ = a.toAscii(); //### - else -#endif - convertToLatin1(a, out); + convertToLatin1(a, out); } static inline void convertToLatin1(QChar a, char *&out) -- cgit v1.2.3