Prior to upgrading to Rails 6.1 we had an old code that was forcing all params to be UTF-8, adapted from here: Rails 2.3.9 Encoding of Query Parameters
Now Rails makes parameters frozen, so this code failed. We've read the docs and the internet and figured that Rails should encode params as UTF-8 by default, and this workaround is not needed anymore. But no, all our parameters are now encoded as ASCII-8BIT.
We have config.encoding = "utf-8"
in application.rb.
I even tried gems 'utf8-cleaner' and 'rack-utf8_sanitizer' - nothing helps, parameters are still have encoding ASCII-8BIT. Don't know if that helps but request.body.read.encoding
is also ASCII-8BIT, but that should be expected, I think.
Is it's our code/config issue?