modifs.mineures sans commentaires
This commit is contained in:
parent
07c927f34a
commit
a76f820fa6
|
@ -2,7 +2,6 @@
|
||||||
namespace nur\sery\ext;
|
namespace nur\sery\ext;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use nur\sery\cl;
|
|
||||||
use nur\sery\ext\json\JsonException;
|
use nur\sery\ext\json\JsonException;
|
||||||
use nur\sery\file;
|
use nur\sery\file;
|
||||||
use nur\sery\os\IOException;
|
use nur\sery\os\IOException;
|
||||||
|
|
|
@ -12,7 +12,7 @@ use nur\sery\file\TmpfileWriter;
|
||||||
* Class file: outils pour gérer les fichiers
|
* Class file: outils pour gérer les fichiers
|
||||||
*/
|
*/
|
||||||
class file {
|
class file {
|
||||||
private static function fix_dash($file) {
|
static function fix_dash($file) {
|
||||||
if ($file === "-") $file = null;
|
if ($file === "-") $file = null;
|
||||||
return $file;
|
return $file;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
namespace nur\sery\file\csv;
|
namespace nur\sery\file\csv;
|
||||||
|
|
||||||
|
use nur\sery\file;
|
||||||
use nur\sery\file\FileReader;
|
use nur\sery\file\FileReader;
|
||||||
|
|
||||||
class CsvReader extends AbstractReader {
|
class CsvReader extends AbstractReader {
|
||||||
|
@ -17,7 +18,7 @@ class CsvReader extends AbstractReader {
|
||||||
protected ?string $inputEncoding;
|
protected ?string $inputEncoding;
|
||||||
|
|
||||||
function getIterator() {
|
function getIterator() {
|
||||||
$reader = new FileReader($this->input);
|
$reader = new FileReader(file::fix_dash($this->input));
|
||||||
$inputEncoding = $this->inputEncoding;
|
$inputEncoding = $this->inputEncoding;
|
||||||
if ($inputEncoding !== null) {
|
if ($inputEncoding !== null) {
|
||||||
$reader->appendFilter("convert.iconv.$inputEncoding.utf-8");
|
$reader->appendFilter("convert.iconv.$inputEncoding.utf-8");
|
||||||
|
|
Loading…
Reference in New Issue