#29163 [Asn->Fbk]: field consisting of one space char is read as an empty string by fgetcsv
| From: | sniper@php.net | Date: | Sun, 06 Mar 2005 19:42:38 +0000 |
| Subject: | #29163 [Asn->Fbk]: field consisting of one space char is read as an empty string by fgetcsv | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-74957@lists.php.net to get a copy of this message | ||
ID: 29163
Updated by: sniper@php.net
Reported By: ramon_herrera at eloyalty dot com
-Status: Assigned
+Status: Feedback
Bug Type: Filesystem function related
Operating System: win2k & GNU/Linux (FC2)
PHP Version: 5.0.1
Assigned To: moriyoshi
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2004-10-15 18:33:35] moriyoshi@php.net
Just FYI: have a look at http://voltex.jp/articles/
csvtests/
------------------------------------------------------------------------
[2004-09-02 17:53:14] ramon_herrera at eloyalty dot com
Thanks to the person at "php at tntweb dot f9 dot co dot uk" for
pointing to what I see is a very nice-looking doc at the creativyst.com
site.
Does anybody know if something like an RFC exists for CSV? If not,
should we just make one for PHP and stick with it? Or should we
compare CSV functions against those of other popular software
applications and judge accordingly?
IMPORTANT: The creativyst.com page that's linked to in the previous
comment has a restrictive-looking notice at the bottom. Don't
copy/redistribute that material without their permission.
------------------------------------------------------------------------
[2004-09-02 15:04:58] php at tntweb dot f9 dot co dot uk
White space between fields should be ignored, so the field ..., ,...
should be returned as an empty string and not a single space. The
latest PHP 4 version breaks this and returns a single space.
To include leading or trailing spaces then they must be quoted.
For further info read
http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm
------------------------------------------------------------------------
[2004-08-13 08:12:12] ramon_herrera at eloyalty dot com
IMO, correctness trumps backwards compatibility in this case,
especially since pre-4.3.4 was so long ago. Compatibility with
something that was broken is not a persuasive argument.
If a single space char is what a CSV field is comprised of, then, IMO,
that is exactly how it should be represented in this function's result.
Must there be quotes? Backslash escapes? What else is needed?
Moriyoshi, what do your colleagues believe?
------------------------------------------------------------------------
[2004-08-13 07:16:39] ramon_herrera at eloyalty dot com
This bug shows up in version 5.0.1 under Fedora Core 2.
------------------------------------------------------------------------
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
http://bugs.php.net/29163
--
Edit this bug report at http://bugs.php.net/?id=29163&edit=1