diff options
Diffstat (limited to 'src/xml/dom/qdom.cpp')
-rw-r--r-- | src/xml/dom/qdom.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index 486894019c..e0e9a465ef 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -22,7 +22,7 @@ #include <qdebug.h> #include <qxmlstream.h> #include <private/qduplicatetracker_p.h> - +#include <private/qstringiterator_p.h> #include <stdio.h> #include <limits> @@ -156,10 +156,11 @@ static QString fixedCharData(const QString &data, bool *ok) } QString result; - for (int i = 0; i < data.size(); ++i) { - QChar c = data.at(i); + QStringIterator it(data); + while (it.hasNext()) { + const char32_t c = it.next(QChar::Null); if (QXmlUtils::isChar(c)) { - result.append(c); + result.append(QChar::fromUcs4(c)); } else if (QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::ReturnNullNode) { *ok = false; return QString(); |