Question re: should this be rack's job
# config.ru
run ->(env) {
[ 200, { 'Content-Type' => 'text/html', }, [Rack::Request.new(env).params.inspect] ]
}
rackup
open http://localhost:9292/?utf8=%E2%9C%93&search=&page=2&commit=%u00ABscript%u00BBalert(209);%u00AB/script%u00BB
ArgumentError at /
invalid %-encoding (%u00ABscript%u00BBalert(209))
Ruby $HOME/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/uri/common.rb: in decode_www_form_component, line 898
Web GET localhost/
Would you argue that rackup is not an acceptable app server, then? If not, would you accept a PR to rescue the Argument error in rack, warn that it's the app server's job to fix the issue, and re-raise it?
edit: I forgot posted a similar comment in rack/rack#323 (comment)
I found this solution which is more compact and working well:
link: http://dev.mensfeld.pl/2014/03/rack-argument-error-invalid-byte-sequence-in-utf-8/
Tell me which one is better.