浏览代码

[fix] bing unicode issue part III.

Adam Tauber 8 年前
父节点
当前提交
16f2e346b3
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      searx/engines/bing.py

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

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