diff options
author | Robin Burchell <robin+qt@viroteck.net> | 2012-01-30 14:23:22 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-22 14:00:32 +0100 |
commit | 186692f81f2612c3cf3a4090cbf949f2fb1558f8 (patch) | |
tree | e4506e520a88a1c75086516a1edeb1ab2fb4d057 /src/corelib/tools/qstringbuilder.cpp | |
parent | 9d173c92183c30144e8bd4f115b2cd93c3da0d40 (diff) |
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 <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/tools/qstringbuilder.cpp')
-rw-r--r-- | src/corelib/tools/qstringbuilder.cpp | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/corelib/tools/qstringbuilder.cpp b/src/corelib/tools/qstringbuilder.cpp index 3d6b0eb709..30c4399cc9 100644 --- a/src/corelib/tools/qstringbuilder.cpp +++ b/src/corelib/tools/qstringbuilder.cpp @@ -105,14 +105,6 @@ QT_BEGIN_NAMESPACE */ void QAbstractConcatenable::convertFromAscii(const char *a, int len, QChar *&out) { -#ifndef QT_NO_TEXTCODEC - if (QString::codecForCStrings && len) { - QString tmp = QString::fromAscii(a, len > 0 ? len : -1); - memcpy(out, reinterpret_cast<const char *>(tmp.constData()), sizeof(QChar) * tmp.size()); - out += tmp.length(); - return; - } -#endif if (len == -1) { if (!a) return; @@ -127,14 +119,6 @@ void QAbstractConcatenable::convertFromAscii(const char *a, int len, QChar *&out /*! \internal */ void QAbstractConcatenable::convertToAscii(const QChar* a, int len, char*& out) { -#ifndef QT_NO_TEXTCODEC - if (QString::codecForCStrings) { - QByteArray tmp = QString::codecForCStrings->fromUnicode(a, len); - memcpy(out, tmp.constData(), tmp.size()); - out += tmp.length(); - return; - } -#endif if (len == -1) { while (a->unicode()) convertToLatin1(*a++, out); |