This method is deprecated or moved on the latest stable version.
The last existing version (v3.2.13) is shown here.
encode_params(params)
private
TODO: Validate that the characters are UTF-8. If they aren’t, you’ll
get a weird error down the road, but our form handling should really
prevent that from happening
# File actionpack/lib/action_dispatch/http/parameters.rb, line 47
def encode_params(params)
return params unless "ruby".encoding_aware?
if params.is_a?(String)
return params.force_encoding("UTF-8").encode!
elsif !params.is_a?(Hash)
return params
end
params.each do |k, v|
case v
when Hash
encode_params(v)
when Array
v.map! {|el| encode_params(el) }
else
encode_params(v)
end
end
end