RoR之字符编码问题

来源:互联网 发布:宽带网络价格 编辑:程序博客网 时间:2024/05/17 01:34

在使用JavaScriptHelper的时候如果用到符编码,

例如,使用过滤器过滤字符编码:

        before_filter :set_charset

  

        def set_charset

            @headers["Content-Type"] = "text/html; charset=utf-8"

        end

 

需要设置index.xhtml的编码格式为utf-8, 否则会提示错误

原创粉丝点击