@@ -2,6 +2,7 @@ from collections import Iterable
22from json import loads
33from sys import version_info
44from searx.url_utils import urlencode
5+from searx.utils import to_string
56
67if version_info[0] == 3:
78 unicode = str
@@ -111,14 +112,22 @@ def response(resp):
111112 content = query(result, content_query)[0]
112113 except:
113114 content = ""
114− results.append({'url': url, 'title': title, 'content': content})
115+ results.append({
116+ 'url': to_string(url),
117+ 'title': to_string(title),
118+ 'content': to_string(content),
119+ })
115120 else:
116121 for url, title, content in zip(
117122 query(json, url_query),
118123 query(json, title_query),
119124 query(json, content_query)
120125 ):
121− results.append({'url': url, 'title': title, 'content': content})
126+ results.append({
127+ 'url': to_string(url),
128+ 'title': to_string(title),
129+ 'content': to_string(content),
130+ })
122131
123132 if not suggestion_query:
124133 return results