简体   繁体   中英

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)

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 !

Do you have any idea where it comes from ? is there a rails/ruby patchs for this issue ?

Thanks,

I think you problem com from template encoding in UTF-8 not in ASCII, like attempts.

In Rails 3, there are a new configuration for that :

# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM