From a94bf13b892eed875e545dee1193afc689c67a4f Mon Sep 17 00:00:00 2001 From: Rodney Figaro Date: Wed, 12 Apr 2017 17:21:29 +0200 Subject: [PATCH] module training - remove BOM and convert to ISO-8859-1 in CSV writing --- modules/training/models/CSVWriter.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/training/models/CSVWriter.php b/modules/training/models/CSVWriter.php index 99e511f..d0e5ac7 100644 --- a/modules/training/models/CSVWriter.php +++ b/modules/training/models/CSVWriter.php @@ -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); }