I need to url encode foreign names, like "Misère".
When I do:
urllib2.quote(name)
I get a the error:
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'
What am I doing wrong?
Try:
urllib2.quote(s.encode('utf8'))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With