Skip to content
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

Custom fputcsv #79

Open
oliverskawronek opened this issue Dec 20, 2018 · 1 comment
Open

Custom fputcsv #79

oliverskawronek opened this issue Dec 20, 2018 · 1 comment

Comments

@oliverskawronek
Copy link

Thanks for this library!

I took a look into CsvObjectFile and saw that you are utilize the PHP's own fputcsv by writing into a temp stream and catch the written line.

It would be nice, if you could write your own fputcsv that would be more customizable. Some features that could be implemented with that are:

(I know, that you already have a filter mechanism. But the filter is feed with serialized line splitted by the spearator as strings, not with the raw data).

@theking2
Copy link

I concur, the standard fputcsv in php7 is not very flexible. I suggest to go to the RFC 4180 that is more specific.

  • What is missing is a customizable record separator (might be \r or \n or \r\n, or something completely different)
  • The default behavior of escaping an enclosure by repeating it is rather random, throwing an exception if no escape_char is supplied might actually be good for defensive programming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants