我将数据导出到rails中的CSV文件和我的某些字段中,当我在Excel中打开时,我遇到了类似的字符编码问题:
didn’t
Run Code Online (Sandbox Code Playgroud)
我从一个例子中借用了这段代码,我假设编码已关闭.知道应该是什么吗?
send_data csv_data,
:type => 'text/csv; charset=iso-8859-1; header=present',
:disposition => "attachment; filename=#{filename}.csv"
Run Code Online (Sandbox Code Playgroud)