Req #51496 [Com]: fgetcsv should take empty string as an escape

From: Date: Sun, 17 Jun 2018 23:35:27 +0000
Subject: Req #51496 [Com]: fgetcsv should take empty string as an escape
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215766@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=51496&edit=1 ID: 51496 Comment by: php at sameprecision dot org Reported by: kulakov74 at yandex dot ru Summary: fgetcsv should take empty string as an escape Status: Open Type: Feature/Change Request Package: Filesystem function related Operating System: All PHP Version: 5.3.2 Block user comment: N Private report: N New Comment: The escape character was probably intended to be an alternative to doubling up the enclosure character: place the escape character in front of the enclosure character and itself (fputcsv doesn't put the escape character in front of itself so it is useless as an escape character). Friends and I commented on this issue a LONG time ago and have been using a user-land function because fputcsv is a data-lossy function. Previous Comments: ------------------------------------------------------------------------ [2018-02-15 17:16:01] cmb@php.net Related To: Bug #66727 ------------------------------------------------------------------------ [2017-09-11 23:53:08] cmb@php.net Related To: Bug #43225 ------------------------------------------------------------------------ [2016-08-26 14:02:24] cmb@php.net Any news here? In my opinion, this feature is a must-have, because escaping in CSV files with an escape character is pretty uncommon, and I'm not even sure how $escape is supposed to work currently (see bug #67566). ------------------------------------------------------------------------ [2016-08-26 13:58:43] cmb@php.net Related To: Bug #72945 ------------------------------------------------------------------------ [2014-12-02 14:06:08] datibbaw@php.net I'm currently making my way through all reported issues against CSV related functions in order to fix them for PHP 7. I believe that this particular issue can be resolved by using the double quote as both the enclosure AND escape character; in fact, this should be the default, because a backslash makes no sense at all if you consider other applications such as Numbers, Excel and Calc that do not treat a backslash as anything special. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=51496 -- Edit this bug report at https://bugs.php.net/bug.php?id=51496&edit=1

« previous php.bugs (#215766) next »