radiant/radiant — pull request #326 by jfahrenkrug (2012-03-14 17:36:09+00:00)
Title: Force form params into UTF-8 encoding when using Ruby 1.9.x

This is basically a back port of Rails 3 built-in behavior.

Background: When entering special chars like umlauts in Radiant forms (like the admin page forms), these strings enter Rails as ASCII-8BIT-encoded strings. That causes lots of problems, especially with some DB-backends like DB2.

The solution is to force the encoding of incoming params to UTF-8. While that is not a perfect solution, it's much better than the current situation.

More background:

Rails discussion about this: https://rails.lighthouseapp.com/projects/8994/tickets/4807
@wycats' commit to Rails 3: https://github.com/rails/rails/commit/25215d7285db10e2c04d903f251b791342e4dd6a
SO discussion: http://stackoverflow.com/questions/8268778/rails-2-3-9-encoding-of-query-parameters
Blog post: http://jasoncodes.com/posts/ruby19-rails2-encodings (thanks for the following code, Jason!)

Let me know what you guys think.

- Johannes