新手问题 关于读取 SQL Server-GB2312 编码的显示问题

buyhome · 2013年06月03日 · 最后由 buyhome 回复于 2013年06月03日 · 3308 次阅读

下面脚手架创建


class CreateOutdoorlogs < ActiveRecord::Migration
  def self.up
    create_table :outdoorlogs do |t|
      t.string :title
      t.text :description

      t.timestamps
    end
  end

  def self.down
    drop_table :outdoorlogs
  end
end

title 在编辑时,汉字不能显示。description 中的汉字则能显示。

为何?

已经加了

<meta http-equiv="content-type" content="text/html;charset=gb2312" />

Rails 默认数据库的编码是 UTF-8

#1 楼 @huacnlee 数据库上有很多系统在跑的数据,我没办法去改公司 sqlserver 的编码(gb2312),怎么搞?

#2 楼 @buyhome 哦,对不起,没注意看 SQL Server... 这个我也没搞过,你再查查资料

#3 楼 @huacnlee 好,我研究一下,跟进发在帖子后面。

需要 登录 后方可回复, 如果你还没有账号请 注册新账号