diff --git a/src/AbstractCsv.php b/src/AbstractCsv.php index 74a13eca..5b332bf0 100644 --- a/src/AbstractCsv.php +++ b/src/AbstractCsv.php @@ -224,7 +224,7 @@ public static function createFromString($str) ); } $obj = new SplTempFileObject(); - $obj->fwrite((string) $str.PHP_EOL); + $obj->fwrite(rtrim($str)."\n"); return static::createFromFileObject($obj); } @@ -242,8 +242,9 @@ protected function newInstance($class_name, $open_mode) $csv = new $class_name($this->path, $open_mode); $csv->delimiter = $this->delimiter; $csv->enclosure = $this->enclosure; - $csv->escape = $this->escape; + $csv->escape = $this->escape; $csv->encodingFrom = $this->encodingFrom; + $csv->bom = $this->bom; return $csv; }