In Python, I can do this:
>>> import urlparse, urllib >>> q = urlparse.parse_qsl(\"a=b&a=c&d=e\") >>> urllib.urlencode(q) \'a=
In modern ruby this is simply:
require 'uri' URI.encode_www_form(hash)