Req #51496 [Asn->Opn]: fgetcsv should take empty string as an escape

From: Date: Tue, 24 Oct 2017 07:18:26 +0000
Subject: Req #51496 [Asn->Opn]: fgetcsv should take empty string as an escape
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212054@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
 Updated by:         kalle@php.net
 Reported by:        kulakov74 at yandex dot ru
 Summary:            fgetcsv should take empty string as an escape
-Status:             Assigned
+Status:             Open
 Type:               Feature/Change Request
 Package:            Filesystem function related
 Operating System:   All
 PHP Version:        5.3.2
-Assigned To:        aharvey
+Assigned To:        
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[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.

------------------------------------------------------------------------
[2012-04-10 21:02:39] laurent at chardin dot org

fgetcsv should also take empty strings as an enclosure.
I got the case of dealing with CSV files without enclosures, only comma-delimited 
values. fgetcsv complains when trying to set either of those values:
NULL
'\0'

using '\0' did the trick, but at the cost of a tons of warnings:
fgetcsv(): enclosure must be a single character

Is there another caracter that could act as an empty one ?

------------------------------------------------------------------------


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


Thread (10 messages)

« previous php.bugs (#212054) next »