rfc:kill-csv-escaping

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:kill-csv-escaping [2018/09/27 10:59] – Add discussion link cmbrfc:kill-csv-escaping [2018/12/02 15:19] (current) – Withdraw RFC cmb
Line 4: Line 4:
   * Date: 2018-09-27   * Date: 2018-09-27
   * Author: Christoph M. Becker, <cmb@php.net>   * Author: Christoph M. Becker, <cmb@php.net>
-  * Status: Under Discussion+  * Status: Withdrawn
   * First Published at: http://wiki.php.net/rfc/kill-csv-escaping   * First Published at: http://wiki.php.net/rfc/kill-csv-escaping
  
 ===== Introduction ===== ===== Introduction =====
  
-For many years, we receive bug reports regarding the strange behavior of the $escape parameter of our CSV writing and reading functions (''fputcsv'', ''fgetcsv'' etc.); the latest has been reported today.  Apparently, this escaping mechanism causes more harm than good.+For many years, we receive bug reports regarding the strange behavior of the $escape parameter of our CSV writing and reading functions (''fputcsv'', ''fgetcsv'' etc.); the latest has been [[https://bugs.php.net/bug.php?id=76940|reported today]].  Apparently, this escaping mechanism causes more harm than good.
  
 Albeit CSV is still a widespread data exchange format, it has never been officially standardized. There exists, however, the “informational” [[https://tools.ietf.org/html/rfc4180|RFC 4180]] which has no notion of escape characters, but rather defines ''escaped'' as strings enclosed in double-quotes where contained double-quotes have to be doubled. While this concept is supported by PHP's implementation (''$enclosure''), the ''$escape'' sometimes interferes, so that ''fgetcsv()'' may be unable to correctly parse externally generated CSV, and ''fputcsv()'' is sometimes generating non-compliant CSV. Even a rountrip ''(fgetcsv(fputcsv(…))'' may fail. Albeit CSV is still a widespread data exchange format, it has never been officially standardized. There exists, however, the “informational” [[https://tools.ietf.org/html/rfc4180|RFC 4180]] which has no notion of escape characters, but rather defines ''escaped'' as strings enclosed in double-quotes where contained double-quotes have to be doubled. While this concept is supported by PHP's implementation (''$enclosure''), the ''$escape'' sometimes interferes, so that ''fgetcsv()'' may be unable to correctly parse externally generated CSV, and ''fputcsv()'' is sometimes generating non-compliant CSV. Even a rountrip ''(fgetcsv(fputcsv(…))'' may fail.
rfc/kill-csv-escaping.1538045951.txt.gz · Last modified: 2018/09/27 10:59 by cmb