summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Kubicek <foceni@gmail.com>2010-12-20 02:02:16 (GMT)
committer Gavin Hurlbut <ghurlbut@mythtv.org>2010-12-20 02:02:16 (GMT)
commit56dab8455ee03a75e3ec693854bebb44da0cbff0 (patch)
tree547e8b328463c5947d4065d5721e7b88778d9205
parent9abf29a5ec84a8beec4741b94e453d9bf70c34a1 (diff)
Fix UTF-8 handling on UPnP request URLs
Patch from Ticket 9188 Changes UPnP searches, etc to use UTF-8 rather than Latin1.
-rw-r--r--mythtv/libs/libmythupnp/httprequest.cpp12
-rw-r--r--mythtv/libs/libmythupnp/soapclient.cpp6
-rw-r--r--mythtv/libs/libmythupnp/upnpcds.cpp2
-rw-r--r--mythtv/libs/libmythupnp/upnpcdsobjects.cpp2
4 files changed, 11 insertions, 11 deletions
diff --git a/mythtv/libs/libmythupnp/httprequest.cpp b/mythtv/libs/libmythupnp/httprequest.cpp
index 766d04e..0652821 100644
--- a/mythtv/libs/libmythupnp/httprequest.cpp
+++ b/mythtv/libs/libmythupnp/httprequest.cpp
@@ -852,8 +852,8 @@ long HTTPRequest::GetParameters( QString sParams, QStringMap &mapParams )
if ((sName.length() != 0) && (sValue.length() !=0))
{
- sName = QUrl::fromPercentEncoding(sName.toLatin1());
- sValue = QUrl::fromPercentEncoding(sValue.toLatin1());
+ sName = QUrl::fromPercentEncoding(sName.toUtf8());
+ sValue = QUrl::fromPercentEncoding(sValue.toUtf8());
mapParams.insert( sName.trimmed(), sValue );
nCount++;
@@ -1093,12 +1093,12 @@ void HTTPRequest::ProcessRequestLine( const QString &sLine )
if (nCount > 1)
{
//m_sBaseUrl = tokens[1].section( '?', 0, 0).trimmed();
- m_sBaseUrl = (QUrl::fromPercentEncoding(tokens[1].toLatin1())).section( '?', 0, 0).trimmed();
+ m_sBaseUrl = (QUrl::fromPercentEncoding(tokens[1].toUtf8())).section( '?', 0, 0).trimmed();
// Process any Query String Parameters
//QString sQueryStr = tokens[1].section( '?', 1, 1 );
- QString sQueryStr = (QUrl::fromPercentEncoding(tokens[1].toLatin1())).section( '?', 1, 1 );
+ QString sQueryStr = (QUrl::fromPercentEncoding(tokens[1].toUtf8())).section( '?', 1, 1 );
if (sQueryStr.length() > 0)
GetParameters( sQueryStr, m_mapParams );
@@ -1307,8 +1307,8 @@ bool HTTPRequest::ProcessSOAPPayload( const QString &sSOAPAction )
if (!oText.isNull())
sValue = oText.nodeValue();
- sName = QUrl::fromPercentEncoding(sName.toLatin1());
- sValue = QUrl::fromPercentEncoding(sValue.toLatin1());
+ sName = QUrl::fromPercentEncoding(sName.toUtf8());
+ sValue = QUrl::fromPercentEncoding(sValue.toUtf8());
m_mapParams.insert( sName.trimmed(), sValue );
}
diff --git a/mythtv/libs/libmythupnp/soapclient.cpp b/mythtv/libs/libmythupnp/soapclient.cpp
index f1ec421..c028c4c 100644
--- a/mythtv/libs/libmythupnp/soapclient.cpp
+++ b/mythtv/libs/libmythupnp/soapclient.cpp
@@ -139,7 +139,7 @@ QString SOAPClient::GetNodeValue( QDomNode &node, const QString &sName, const QS
if (!oText.isNull())
sValue = oText.nodeValue();
- return QUrl::fromPercentEncoding(sValue.toLatin1());
+ return QUrl::fromPercentEncoding(sValue.toUtf8());
}
return sDefault;
@@ -261,8 +261,8 @@ bool SOAPClient::SendSOAPRequest( const QString &sMethod,
if (!oText.isNull())
sValue = oText.nodeValue();
- list.insert(QUrl::fromPercentEncoding(sName.toLatin1()),
- QUrl::fromPercentEncoding(sValue.toLatin1()));
+ list.insert(QUrl::fromPercentEncoding(sName.toUtf8()),
+ QUrl::fromPercentEncoding(sValue.toUtf8()));
}
}
}
diff --git a/mythtv/libs/libmythupnp/upnpcds.cpp b/mythtv/libs/libmythupnp/upnpcds.cpp
index 89d537f..0861f02 100644
--- a/mythtv/libs/libmythupnp/upnpcds.cpp
+++ b/mythtv/libs/libmythupnp/upnpcds.cpp
@@ -994,7 +994,7 @@ UPnpCDSExtensionResults *UPnpCDSExtension::ProcessKey( UPnpCDSRequest *
// ----------------------------------------------------------------------
QString sKey = idPath.last().section( '=', 1, 1 );
- sKey = QUrl::fromPercentEncoding(sKey.toLatin1());
+ sKey = QUrl::fromPercentEncoding(sKey.toUtf8());
if (sKey.length() > 0)
{
diff --git a/mythtv/libs/libmythupnp/upnpcdsobjects.cpp b/mythtv/libs/libmythupnp/upnpcdsobjects.cpp
index 552b559..8a8d985 100644
--- a/mythtv/libs/libmythupnp/upnpcdsobjects.cpp
+++ b/mythtv/libs/libmythupnp/upnpcdsobjects.cpp
@@ -128,7 +128,7 @@ QString CDSObject::GetPropValue(const QString &sName) const
Properties::const_iterator it = m_properties.find(sName);
if (it != m_properties.end() && *it)
- return QUrl::fromPercentEncoding((*it)->m_sValue.toLatin1());
+ return QUrl::fromPercentEncoding((*it)->m_sValue.toUtf8());
return "";
}