Why are all strings ASCII-8BIT after I upgraded to Rails 3?

后端 未结 3 666
無奈伤痛
無奈伤痛 2020-12-16 04:53

I upgraded to RoR 3.0.1 and Ruby to 1.9.2. Now all the strings in my views are ASCII-8BIT?

I believe I have my app set up to use UTF 8

3条回答
  •  北海茫月
    2020-12-16 05:19

    I'm moving from Ruby 1.8.6 and Rails 2.3.5 to Ruby 1.9.2 and Rails 3.0.3, with postregsql. In order to get this working on my project, I had to do add this to the top of any of my view templates that were being translated:

    <% # coding: UTF-8 %>
    

    The rake task provided by Ole should be easy to modify to do this as well. I didn't find his solution as given had any effect, though.

提交回复
热议问题