After updating my Rails applications to the new 3.0.20 version (which fixes CVE-2013-0333), I'm getting this error: Encoding::CompatibilityError - incompatible character encodings: UTF-8 and ASCII-8BIT
Investigating the commit 5375dce (Add an OkJson backend and remove the YAML backend) I could notice that the line "# encoding: UTF-8" is not at the top of the file. Moving it to the top fixes the issue.
@renatosnrg That sounds awfully similar to what we debugged yesterday in our apps. Your error message isn't the same as what we had, but very close. We resolved to use the JSONGem, which "just works".
ActiveSupport::JSON.backend = "JSONGem"
That might fix your issue. This is what we tracked the issue down to: #9121 (comment)
Reading fail on my part. Sorry. Your solution fixes my issue too.
I wanna thank Ingo for this fix, he was the first to solve the problem in ours apps, I just commited his solution (unfortunately he doesn't have a Github account).
We continue having issues with accented chars :(
Migrating backend to "JSONGem" fixed the problem!
By the way, does anyone know why OkJson was chosen as ActiveSupport default backend?