# fputcsv is not compliant with the CSV RFC

- Thread: https://externals.io/message/112248
- Original archive: https://news-web.php.net/php.internals/112248
- Started by Cameron Hall on 2020-11-15T02:01:34+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #112248 — Cameron Hall — 2020-11-15T02:01:34+00:00

URL: https://externals.io/message/112248#112248

Hi internals,

I've come across a small nuance recently noticing that the fputcsv function
isn't compliant with the RFC because it uses LF as a line terminator
instead of CRLF as per RFC 4810[1]. There are a few related bug reports
already; #42357[4], #46367[2] and #62770[3].

I've created a pull request[5] to address the issue by adding a new
parameter that allows a user defined line ending as suggested in bug report
#42357[4]. In order to maintain backwards compatibility, `fputcsv()` still
terminates lines with "\n" by default.

While my pull request is addressing a bug, adding a new parameter is also a
new feature. I'd love to see some opinions from the internals team
regarding the best way forward.

Kind regards,

Cameron

[1] https://tools.ietf.org/html/rfc4180
[2] https://bugs.php.net/bug.php?id=46367
[3] https://bugs.php.net/bug.php?id=62770
[4] https://bugs.php.net/bug.php?id=42357

[5] https://github.com/php/php-src/pull/6403
