I need to get an â
character into a format that can be passed to a URL. I'm obtaining some names as a json list, and then passing them elsewhere.
result = json.load(urllib2.urlopen(LIST_URL), encoding='latin-1')
for item in result:
name = item["name"]
print name
print urllib2.quote(name.lower())
This produces a urllib error when the name is Siân:
Siân
Line 24 - print urllib2.quote(mp_name.lower())
/usr/lib/python2.6/urllib.py -- quote((s=u'si\xe2n', safe='/'))
KeyError(u'\xe2')
Please could anyone advise?