Commit a1aee333 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
parent aaa3b61e
......@@ -21,6 +21,9 @@
#include "OpenSearchEngine.h"
#include <KDE/KGlobal>
#include <KDE/KLocale>
#include <QtCore/QRegExp>
#include <QtCore/QStringList>
#include <QtScript/QScriptEngine>
......@@ -44,12 +47,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;
}
......@@ -195,8 +196,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