Possibly better to use URI.encode_www_form instead of pulling in rack/utils.