From 3c03878293bf2a155762a61d3a29c958eddbe0b1 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 20 Oct 2011 00:21:08 +0200 Subject: 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 --- src/xmlpatterns/functions/qstringvaluefns.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/xmlpatterns/functions') 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 = "#!*'()"; -- cgit v1.2.1