From 5f79f1cad95b9a93e3bb3a2023d1218fddf3cd79 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Mon, 1 Jul 2024 11:46:25 +0400 Subject: [PATCH] modifs.mineures sans commentaires --- src/file/csv/CsvReader.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/file/csv/CsvReader.php b/src/file/csv/CsvReader.php index b824d20..1e13741 100644 --- a/src/file/csv/CsvReader.php +++ b/src/file/csv/CsvReader.php @@ -9,12 +9,19 @@ class CsvReader extends AbstractReader { function __construct($input, ?array $params=null) { parent::__construct($input, $params); $this->csvFlavour = $params["csv_flavour"] ?? null; + $this->inputEncoding = $params["input_encoding"] ?? null; } protected ?string $csvFlavour; + protected ?string $inputEncoding; + function getIterator() { $reader = new FileReader($this->input); + $inputEncoding = $this->inputEncoding; + if ($inputEncoding !== null) { + $reader->appendFilter("convert.iconv.$inputEncoding.utf-8"); + } $reader->setCsvFlavour($this->csvFlavour); while (($row = $reader->fgetcsv()) !== null) { foreach ($row as &$col) {