-
-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BOM and enclosured multiline data #483
Comments
@cbepxpa3ym thanks for reporting the bug. This on is due to the underlying PHP CSV parser. Not sure If I can easily fix it. I will have to take a closer look at how to remove the BOM sequence prior to ask PHP to parse the CSV |
Once the next minor version is released you will be able to do the following: <?php
use League\Csv\Reader;
use League\Csv\SkipBOMSequence;
SkipBOMSequence::register();
$reader = Reader::createFromString($sequence.$data);
$reader->includeInputBOM();
$reader->addStreamFilter(SkipBOMSequence::getFiltername()); Which will fix your issue. If you can't wait until then you can already copy/paste the following class https://github.com/thephpleague/csv/blob/master/src/SkipBOMSequence.php in your codebase. Make sure to read the documentation to understand its usage and shortcomings https://csv.thephpleague.com/9.0/connections/bom/#removing-the-bom-sequence . |
Bug Report
Summary
There is an issue with BOM and enclosured multiline data.
Standalone code, or other way to reproduce the problem
Option 1
Create new file in Excel and enter this text into the 1st column:
Save it as CSV with UTF8 encoding and run the following code:
Option 2
Run the following code:
Expected result
'start
end'
Actual result
'"start'
Note
It works as expected if there is no BOM.
The text was updated successfully, but these errors were encountered: