-
-
Notifications
You must be signed in to change notification settings - Fork 333
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
empty first record is not skipped if it contains a BOM sequence #394
Comments
Merged
nyamsprod
changed the title
The library does not skip empty records as it is promised in documentation
empty first record is not skipped if it contains a BOM sequence
Aug 31, 2020
@dariusheivazi a PR has been created with the bug fix could you test the branch to see if it behave as expected. |
@nyamsprod, Hi, The PR works like a charm. I tested it, and it works perfectly (at least for my case). Thanks a lot. |
nyamsprod
added a commit
that referenced
this issue
Aug 31, 2020
Bug fix merged to master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The library does not skip empty records as it is promised in documentation: By default the CSV document normalization removes empty records.
I investigated the flow. The problem comes from the normalizing function. If the first record is empty, it does not skip that. In Issue 393 I tried to explaine it. Technically first line may contain BOM, so the normalizing funtion does not find it as null. The resolution is: makethe normalizing funtion a little bit more smart. That may be done by changing the Line 256 of file Reader.php:
FROM
return is_array($record) && ($this->is_empty_records_included || $record != [null]);
TO:
return is_array($record) && ($this->is_empty_records_included || ($record != [null] && $record != [$this->input_bom]));
and It should work, of course if this does not cuase BC break. Anyway. Thanks for this great library. I hope you see this comment.
Originally posted by @dariusheivazi in #393 (comment)
The text was updated successfully, but these errors were encountered: