summaryrefslogtreecommitdiff
path: root/src/xmlpatterns/functions/qstringvaluefns.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2011-10-20 00:21:08 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-20 15:49:35 +0200
commit3c03878293bf2a155762a61d3a29c958eddbe0b1 (patch)
treef0a3532d628e4927b1d000292f7bed10baffc1f9 /src/xmlpatterns/functions/qstringvaluefns.cpp
parent36ff2e99f7474c93b3a8f6578a2717dad81034d7 (diff)
downloadqtxmlpatterns-3c03878293bf2a155762a61d3a29c958eddbe0b1.tar.gz
Use the new QUrl API
Use QByteArray::{from,to}PercentEncoding when operating directly on byte arrays. Don't use toEncoded/fromEncoded if the final source/destination is a QString -- QUrl's constructor and toString() are fine for that. Change-Id: I9349c2c6a12c43b8c5a4a4fca1fa796272ca90fa Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'src/xmlpatterns/functions/qstringvaluefns.cpp')
-rw-r--r--src/xmlpatterns/functions/qstringvaluefns.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/xmlpatterns/functions/qstringvaluefns.cpp b/src/xmlpatterns/functions/qstringvaluefns.cpp
index d3cb62f..0656721 100644
--- a/src/xmlpatterns/functions/qstringvaluefns.cpp
+++ b/src/xmlpatterns/functions/qstringvaluefns.cpp
@@ -345,9 +345,8 @@ Item EncodeString::evaluateSingleton(const DynamicContext::Ptr &context) const
if(!item)
return CommonValues::EmptyString;
- return AtomicString::fromValue(QString::fromAscii(QUrl::toPercentEncoding(item.stringValue(),
- m_excludeChars,
- m_includeChars).constData()));
+ return AtomicString::fromValue(item.stringValue().toUtf8().toPercentEncoding(m_excludeChars,
+ m_includeChars).constData());
}
const char *const EncodeForURIFN::include = "#!*'()";