You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A lot of people, myself included, expected the 3 CSV-functions:
fputcsv()
fgetcsv()
str_getcsv()
to work in the most consistent/standard/obvious way when called without the optional parameters.
But it doesn't! The default is backwards - if you want to be RFC-4180 compliant, you need to explicitly set the 5th option to be the empty string. This is unusual for PHP: normally optional parameters can be omitted unless you want to do something unusual. This has bitten people repeatedly, even leading to an RFC: https://wiki.php.net/rfc/kill-csv-escaping
So, my suggestion is that each of these 3 has a clearly worded "Note" added, namely:
The default-value of the proprietary-escape mechanism is "", which is inconsistent with the most common standard
for CSV files, RFC-4180. For compatibility, it is recommended that you always explicitly specify the 5th parameter,
'escape', as "", i.e. the empty string.
Thanks.
The text was updated successfully, but these errors were encountered:
A lot of people, myself included, expected the 3 CSV-functions:
to work in the most consistent/standard/obvious way when called without the optional parameters.
But it doesn't! The default is backwards - if you want to be RFC-4180 compliant, you need to explicitly set the 5th option to be the empty string. This is unusual for PHP: normally optional parameters can be omitted unless you want to do something unusual. This has bitten people repeatedly, even leading to an RFC: https://wiki.php.net/rfc/kill-csv-escaping
So, my suggestion is that each of these 3 has a clearly worded "Note" added, namely:
Thanks.
The text was updated successfully, but these errors were encountered: