我有一些 Cyrilic 数据,我想用 Codeigniter 将其导出为 .csv 文件。问题是方法 csv_from_result() 弄乱了这些字符。
$this->load->dbutil();
$delimiter = ",";
$newline = "\r\n";
$report_result = $this->data_model->get_data_result();
$data['csv'] = $this->dbutil->csv_from_result($report_result, $delimiter, $newline);
在我看来,我有:
<?php
header("Content-type: application/csv-tab-delimited-table; charset=utf-8" );
header("Content-Disposition: attachment; filename=csvdata.csv" );
header("Content-Transfer-Encoding: binary" );
echo $csv;
?>
输出文件包含如下混乱的字符:
ТеÑÑ‚ пиÑмо","54","Референц