[英]rails 2.3.5 with ruby 1.9.1p429 : incompatible character encodings: ASCII-8BIT and UTF-8
I tried the ruby hacks for utf8 (from : http://gist.github.com/273741 ) ... and I'm still getting the following error: ActionView::TemplateError (incompatible character encodings: ASCII-8BIT and UTF-8) 我尝试了utf8的ruby hack(来自: http : //gist.github.com/273741 )...,但仍然收到以下错误:ActionView :: TemplateError(不兼容的字符编码:ASCII-8BIT和UTF- 8)
What is bizarre for me is that the same content if retrieved with a post action (searching the app with an html from) it is displaying well ... however, with get (using an html link) it telling that their is character incompatibility ! 对我来说奇怪的是,如果使用后动作(使用html搜索应用程序)检索的相同内容显示得很好……但是,使用get(使用html链接)则表明它们是字符不兼容!
Do you have any idea where it comes from ? 你有什么想法吗? is there a rails/ruby patchs for this issue ?
是否有针对此问题的rails / ruby补丁?
Thanks, 谢谢,
I think you problem com from template encoding in UTF-8 not in ASCII, like attempts. 我认为您是使用UTF-8而不是ASCII的模板编码(例如尝试)来问题com。
In Rails 3, there are a new configuration for that : 在Rails 3中,有一个新的配置:
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.