Ruby on Rails-编码问题

问题描述:

我正在运行一个RoR应用程序,该应用程序从使用utf8_general_ci作为排序规则的某些事件表中提取数据。

I am running a RoR app that pulls data from some event tables which are using utf8_general_ci as collation.

问题是我的所有页面都呈现如下内容:

The problem is that all my pages render stuff like this:

Atatrk体育场Stadi Nov 02 20:00

Atat�rk Stadi Nov 02 20:00

到目前为止,我已经尝试过:
-更改application中的编码。rb

So far I have tried: - changing the encoding within application.rb


  • 添加

  • adding

<meta charset="utf-8" />


  • 添加

  • adding

    content="text/html;charset=utf-8"
    


  • 以上标记的所有组合以及可能适用于我们内容的所有可能的相关编码。

  • all combinations of above tags with all possible relevant encodings that may apply to our content.

    文档类型为

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    

    我也尝试过HTML5和其他变化。

    I have also tried HTML5 and other variations.

    我还没有尝试过iconv解决方案,宁愿不必走那条路。

    I have not yet tried the iconv solution, would prefer not having to go down that road.

    有有人对如何解决这个问题有任何想法吗?

    Does anyone have any idea on how to resolve this?

    谢谢!
    N。

    Thank you! N.

  • 您是否有编码:config / database.yml文件中为utf8?

    do you have a encoding: utf8 in your config/database.yml file?