module training - remove BOM and convert to ISO-8859-1 in CSV writing

This commit is contained in:
Rodney Figaro 2017-04-12 17:21:29 +02:00
parent 613ba6398c
commit a94bf13b89

View File

@ -56,9 +56,12 @@ class CSVWriter
$this->flush();
}
// convert to ISO-8859-1
$this->buffer = utf8_decode($this->buffer);
$f = fopen($this->file_path, 'w');
if ($f) {
fwrite($f, pack('CCC', 0xEF, 0xBB, 0xBF));
// fwrite($f, pack('CCC', 0xEF, 0xBB, 0xBF));
fwrite($f, $this->buffer);
fclose($f);
}