If {"foo" => "yo%20daddy"}
comes through the url, params[:foo] plays nicely with URI.encode, resolving to:
URI.encode("yo daddy")
#=> "yo%20daddy"
However if "foo" comes as a JSON parameter, it does not.
URI.encode("yo%20daddy")
#=> "yo%2520daddy"
A solution to standardize this is
URI.encode(URI.decode("yo daddy"))
#=> "yo%20daddy"
URI.encode(URI.decode("yo%20daddy"))
#=> "yo%20daddy"
But that seems downright silly. Any better ideas?