读书人

关于encoding utf-八

发布时间: 2013-11-08 17:52:35 作者: rapoo

关于encoding utf-8
一 gem解决方案
https://github.com/m-ryan/magic_encoding
二,rake task 解决方案

#solution is to use BOM http://www.w3.org/International/questions/qa-byte-order-mark or put# encoding: UTF-8or# coding: UTF-8#on top of files in utf-8.#To set UTF-8 globally, you can putconfig.encoding = "utf-8"#in your config/application.rb which is equivalent toEncoding.default_external = Encoding::UTF_8Encoding.default_internal = Encoding::UTF_8#which in turn is the equivalent to putting:# encoding: UTF-8



-

读书人网 >编程

热点推荐