我在页面请求(永久链接)上得到"UTF-8中的无效字节序列",我不知道为什么也不能重现它,但我确实得到了很多这样的例外:
A ArgumentError occurred in products#index:
invalid byte sequence in UTF-8
activesupport (3.0.4) lib/active_support/core_ext/object/blank.rb:68:in `=~'
-------------------------------
Request:
-------------------------------
* URL : http://www.mysite.com/category/category-name-\x8E~ice
* Parameters: {"page"=>1, "controller"=>"products", "action"=>"index", "category"=>"category-name-\x8E~ice"}
Run Code Online (Sandbox Code Playgroud)
最后的字符串不应该在那里(" - \x8E~ice").知道为什么会出现这种情况或者我可以做些什么来调试/重现它?
谢谢
我刚刚发布了一个名为UTF8Cleaner的新宝石,它主要基于@phoet和@pithyless的工作.它包括一个Railtie,所以你可以将它放入你的Gemfile中并忘记那些"无效字节序列"错误.
https://github.com/singlebrook/utf8-cleaner
| 归档时间: |
|
| 查看次数: |
5318 次 |
| 最近记录: |