论坛首页 编程语言技术论坛

ruport中文乱码

浏览 3243 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (7)
作者 正文
   发表时间:2008-01-08  
def index
   table  = Ruport::Data::Table.new :data => [["dd","男",3], [3,4,5]],
               :column_names => %w[姓名 性别 年龄]
   puts table.to_csv  #-------1

   send_data table.to_csv,
      :type         => "application/csv",
      :disposition  => "inline",
      :filename     => "report.csv"
end


  在第四行打印的时候是中文,但是最后到处的文件就是乱码!
   发表时间:2008-01-08  
猜想。你用什麼看CSV?
0 请登录后投票
   发表时间:2008-01-08  
office2007
0 请登录后投票
   发表时间:2008-01-08  
mengwade 写道
office2007


我沒有Office 2007可試。舊的Office 2003不能正確讀出UTF-8的CSV。

0 请登录后投票
   发表时间:2008-05-01  
用记事本打开,另存为ansi。
0 请登录后投票
论坛首页 编程语言技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics