In Python, I can do this:
>>> import urlparse, urllib >>> q = urlparse.parse_qsl(\"a=b&a=c&d=e\") >>> urllib.urlencode(q) \'a=
Here's a quick function to turn your hash into query parameters:
require 'uri' def hash_to_query(hash) return URI.encode(hash.map{|k,v| "#{k}=#{v}"}.join("&")) end