diff options
Diffstat (limited to 'searx/query.py')
-rw-r--r-- | searx/query.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/searx/query.py b/searx/query.py index b8b1c0d2f..828a6fb30 100644 --- a/searx/query.py +++ b/searx/query.py @@ -21,8 +21,12 @@ from searx.languages import language_codes from searx.engines import ( categories, engines, engine_shortcuts ) -import string import re +import string +import sys + +if sys.version_info[0] == 3: + unicode = str VALID_LANGUAGE_CODE = re.compile(r'^[a-z]{2,3}(-[a-zA-Z]{2})?$') @@ -146,7 +150,7 @@ class SearchQuery(object): """container for all the search parameters (query, language, etc...)""" def __init__(self, query, engines, categories, lang, safesearch, pageno, time_range): - self.query = query + self.query = query.encode('utf-8') self.engines = engines self.categories = categories self.lang = lang |