summaryrefslogtreecommitdiffstats
path: root/src/corelib/json/qjsonparser.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2013-10-19 18:54:55 -0400
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-09 22:34:54 +0100
commitd51130cc3a00df8147e2eb0799e06865c901c6e0 (patch)
tree16dd61dc71a36772baec6b9d34e66445dac554c1 /src/corelib/json/qjsonparser.cpp
parent86fa8b4fb800620ef065f5e151fa6896931cfc99 (diff)
Add a new UTF-8 encoder and use it from QString
This is a new and faster UTF-8 encoder, based on the code from QUrl. This code specializes for ASCII, which is the most common case anyway, especially since QString's "ascii" mode is actually UTF-8 now. In addition, make QString::toUtf8 use a stateless encoder. Stateless means that the function doesn't handle state between calls in the form of QTextCodec::ConverterState. This allows it to be faster than otherwise. The new code is in the form of a template so that it can be used from QJsonDocument and QUrl, which have small modifications to how the encoding is handled. Change-Id: I305ee0fd8523cc4ec74c2678cb9ea88b75bac7ac Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/json/qjsonparser.cpp')
0 files changed, 0 insertions, 0 deletions