Here is my solution, comments?
>>> def urldecode(s):
... rslt = {}
... for item in s.split('&'):
... keyValue = item.split('=')
... rslt[ urllib.unquote_plus(keyValue[0]) ] =
urllib.unquote_plus(keyValue[1])
... return rslt
...
>>> urldecode('a=b+c&d%26e=%20f')
{'a': 'b c', 'd&e': ' f'}
>>>
You cannot handle URLs like "city=London&city=Paris". BTW, modern
urlencode accept a list of 2-lists, not only a dict.
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ p...@phd.pp.ru
Programmers don't die, they just GOSUB without RETURN.