Wil*_*ran 6 python escaping urlencode urllib2
我需要url编码外来名称,如"Misère".
当我做:
urllib2.quote(name)
Run Code Online (Sandbox Code Playgroud)
我收到一个错误:
File "/System/Library/Frameworks/Python.framework/Versions/
2.5/lib/python2.5/urllib.py", line 1205, in quote
res = map(safe_map.__getitem__, s)
KeyError: u'\xe8'
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?