Export csv file as utf8 see BT#10895

pull/2458/head
jmontoyaa 8 years ago
parent 607d19b3b4
commit 2a4ea89fd6
  1. 8
      main/inc/lib/export.lib.inc.php

@ -42,10 +42,9 @@ class Export
}
$filePath = api_get_path(SYS_ARCHIVE_PATH).uniqid('').'.csv';
$writer = new CsvWriter();
$writer->setStream(fopen($filePath, 'w'));
$stream = fopen($filePath, 'w');
$writer = new CsvWriter(';', '"', $stream, true);
$writer->prepare();
foreach ($data as $item) {
if (empty($item)) {
$writer->writeItem([]);
@ -75,7 +74,6 @@ class Export
$file = new \SplFileObject($filePath, 'w');
$writer = new ExcelWriter($file);
$writer->prepare();
foreach ($data as $row) {
$writer->writeItem($row);
}

Loading…
Cancel
Save