我们使用的是Rails 3.2.3,Ruby 1.9.1和HAML。 我们有一个Post模型,有时只有在Internet Explorer 9中才会发生非常奇怪的事情。
ActionView::Template::Error (incompatible character encodings: UTF-8 and ASCII-8BIT):错误在以下行中:
= raw @post.contentWich从数据库中返回帖子的内容。 请注意,内容包含HTML标记。
奇怪的是:
该错误仅在使用IE 9的某些计算机上显示。(我们无法在使用相同IE 9版本的其他计算机上重现该错误) 错误有时只会发生。我们试过这个机智没有运气(同样的错误):
= raw @post.content.force_encoding('utf-8')任何见解? 提前致谢。
更新现在几次更改后,错误显示在以下行中:
37: .social那一行没有什么奇怪的东西,只有空格(不是制表符)和“.social”字符串。 这太疯狂了。
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.contentWich 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: .socialThere is nothing weird in that line, just spaces (not tabs) and the ".social" string. This is crazy.
最满意答案
好的,终于找到了问题。 那是个
= link_to "Back" :back这里有更好的解释: link_to中的非ascii字符导致应用程序在rails app中的Internet Explorer 9中失败
Ok, finally found the issue. It was a
= link_to "Back" :backIt's better explained here: Non ascii characters in link_to is causing the app to fail in internet explorer 9 in rails app
更多推荐
发布评论