Commit 4648cc1b authored by Dawit Alemayehu's avatar Dawit Alemayehu
Browse files

Treat returned content as Utf8 since that is what we requested to recieve

in the first place.

BUG: 266808
FIXED-IN: 4.6.5

(cherry picked from commit a1aee333)
parent 9f66e3d2
......@@ -21,6 +21,9 @@
#include "OpenSearchEngine.h"
#include <KDE/KGlobal>
#include <KDE/KLocale>
#include <QtCore/QRegExp>
#include <QtCore/QStringList>
#include <QtScript/QScriptEngine>
......@@ -42,12 +45,10 @@ QString OpenSearchEngine::parseTemplate(const QString &searchTerm, const QString
result.replace(QLatin1String("{count}"), QLatin1String("20"));
result.replace(QLatin1String("{startIndex}"), QLatin1String("0"));
result.replace(QLatin1String("{startPage}"), QLatin1String("0"));
// TODO - get setting from KDE
result.replace(QLatin1String("{language}"), QLatin1String("en-US"));
result.replace(QLatin1String("{language}"), KGlobal::locale()->language());
result.replace(QLatin1String("{inputEncoding}"), QLatin1String("UTF-8"));
result.replace(QLatin1String("{outputEncoding}"), QLatin1String("UTF-8"));
result.replace(QLatin1String("{searchTerms}"), searchTerm);
return result;
}
......@@ -193,8 +194,7 @@ bool OpenSearchEngine::operator<(const OpenSearchEngine &other) const
QStringList OpenSearchEngine::parseSuggestion(const QByteArray &resp)
{
QString response(resp);
response = response.trimmed();
const QString response = QString::fromUtf8(resp.constData(), resp.size()).trimmed();
if (response.isEmpty()) {
return QStringList();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment