I have some data which is in Cyrilic and I wanted to export it in .csv file with Codeigniter. The problem is that the method csv_from_result() messes those characters.
$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);
And in my view I have:
<?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;
?>
The output file, contains messed characters like these:
ТеÑÑ‚ пиÑмо","54","Референц