0
url='https://www.bing.com/search?q=你好&qs=n&form=QBLH&pq=你好&sc=2-0&sp=-1&sk=&cvid=8F0865226C'
urllib.request.urlopen(url)

Then console shows this:

enter image description here

Pierre.Vriens
  • 2,117
  • 75
  • 29
  • 42
C.J
  • 57
  • 1
  • 10
  • 1
    Change your encoding. [Try](http://stackoverflow.com/questions/2276200/changing-default-encoding-of-python) this. – cadaniluk May 09 '16 at 09:33

1 Answers1

0

You will need to encode the double byte chars with quote from urllib.parse.

import urllib.request
from urllib.parse import quote

url='https://www.bing.com/search?q=%s&qs=n&form=QBLH&pq=%s&sc=2-0&sp=-1&sk=&cvid=8F0865226C'%(quote('你好'),quote('你好'))
urllib.request.urlopen(url)

you can read more from : How to deal with unicode string in URL in python3?

Community
  • 1
  • 1
Alex Fung
  • 1,996
  • 13
  • 21