We’re using Rails 3.2.3, Ruby 1.9.1, and HAML. We have a Post model and there is something very weird happening only sometimes and only in Internet Explorer 9.
ActionView::Template::Error (incompatible character encodings: UTF-8 and ASCII-8BIT):
The error is in the following line:
= raw @post.content
Wich returns the post’s content from the database. Note the content has HTML tags.
Weird things are:
- The error only shows on some machines with IE 9. (We can’t reproduce the error in other machines using the same IE 9 build)
- The error only happens sometimes.
We’ve tried this wit no luck (same error):
= raw @post.content.force_encoding('utf-8')
Any insight? Thanks in advance.
Update
After a few changes now the error shows up in the following line:
37: .social
There is nothing weird in that line, just spaces (not tabs) and the “.social” string. This is crazy.
Ok, finally found the issue. It was a
It’s better explained here:
Non ascii characters in link_to is causing the app to fail in internet explorer 9 in rails app