thephpleague / csv

CSV data manipulation made easy in PHP
https://csv.thephpleague.com
MIT License
3.34k stars 336 forks source link

Need setEnclosure(""); whithout space #392

Closed ruevers closed 4 years ago

ruevers commented 4 years ago

(Need setEnclosure(""); whithout space)

Q A
Version 8.1

Question

Need setEnclosure(""); whithout space in laravel

if as set $csv->setEnclosure("");

Get the error

InvalidArgumentException The enclosure must be a single character

public function setEnclosure($enclosure)
{
    if (!$this->isValidCsvControls($enclosure)) {
        throw new InvalidArgumentException('The enclosure must be a single character');
    }
    $this->enclosure = $enclosure;

    return $this;
}

The source data is

Matic Network

if I not set enclosuere he show like this

|"Matic Network"|

and I need just this

|Matic Network|

and if I set setEnclosure("") get errors if i not set it puts the " by defalt

nyamsprod commented 4 years ago

@ruevers please refer to the pinned issue as this has already been discussed