瀏覽代碼

[fix] bing character encoding - closes #760

Adam Tauber 8 年之前
父節點
當前提交
1176505fa4
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      searx/engines/bing.py

+ 2
- 2
searx/engines/bing.py 查看文件

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