[fix] bing character encoding - closes #760

This commit is contained in:
Adam Tauber 2016-11-14 15:47:42 +01:00
parent 17b08d096c
commit 1176505fa4

View File

@ -33,10 +33,10 @@ def request(query, params):
offset = (params['pageno'] - 1) * 10 + 1 offset = (params['pageno'] - 1) * 10 + 1
if params['language'] != 'all': if params['language'] != 'all':
query = u'language:{} {}'.format(params['language'].split('_')[0].upper(), query) query = u'language:{} {}'.format(params['language'].split('_')[0].upper(), query.decode('utf-8'))
search_path = search_string.format( search_path = search_string.format(
query=urlencode({'q': query}), query=urlencode({'q': query.encode('utf-8')}),
offset=offset) offset=offset)
params['url'] = base_url + search_path params['url'] = base_url + search_path