-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Options for Enclosure, Delimiter & Escape #21
Comments
Hello @slpixe , thanks for the suggestion. So, you want an option to always double quote all field values. Do you mind sharing why you want that option? |
In my case, I want to create test data that is very close to the original one. André |
Hey @ryu1kn, thanks for the nice library. |
Already 3 people raising this. (Sorry I somehow missed your comment, @vergissberlin ...) Seems like some programmes are picky on this... And as @slpixe pointed, from RFC 4180 perspective, quoting all fields is possible too.
I was kind of reluctant to introduce this as I think it's parser's responsibility to deal with all valid CSVs (plus I didn't want to complicate csv-writer even it would be minor). But given the reality, I think it's reasonable to allow csv-writer to produce fields always with quotes. |
Introduced |
Hi, Really nice library, and its cool that it supports arrays and objects, and mapping of headers 👍
Seen a few similar previous issues regarding the Delimiter, but I was curious about having enclosures e.g.
"value"
I can see you already have a
for having enclosures for fields that would require it, but it be pretty nice to have the option for all fields to have this.
Although CSV isn't a defined spec, it is mentioned on RFC 4180,
and a other languages library(ies) have supported these options:
[1] https://github.com/thephpleague/csv
My thoughts would be having the enclosure be optional, and if undefined and a field needs quoting it gets quoted as currently works.
But that if a enclosure of
"
is passed through it could wrap all fields.More information here:
https://csv.thephpleague.com/9.0/connections/controls/
The text was updated successfully, but these errors were encountered: