#29163 [Asn]: field consisting of one space char is read as an empty string by fgetcsv
ID: 29163 User updated by: ramon_herrera at eloyalty dot com Reported By: ramon_herrera at eloyalty dot com Status: Assigned Bug Type: Filesystem function related Operating System: win2k & GNU/Linux (FC2) PHP Version: 5.0.1 Assigned To: moriyoshi New Comment: 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. Previous Comments: [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. ---- [2004-08-12 08:25:01] ramon_herrera at eloyalty dot com The bug still shows up in CVS php5-200408120430 under Fedora Core 2. ---- [2004-08-04 08:33:33] ramon_herrera at eloyalty dot com Is this bug destined to be fixed in a later release? 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
#29163 [Asn]: field consisting of one space char is read as an empty string by fgetcsv
ID: 29163 User updated by: ramon_herrera at eloyalty dot com Reported By: ramon_herrera at eloyalty dot com Status: Assigned Bug Type: Filesystem function related Operating System: win2k & GNU/Linux (FC2) PHP Version: 5.0.1 Assigned To: moriyoshi New Comment: 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? Previous Comments: [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. [2004-08-12 08:25:01] ramon_herrera at eloyalty dot com The bug still shows up in CVS php5-200408120430 under Fedora Core 2. [2004-08-04 08:33:33] ramon_herrera at eloyalty dot com Is this bug destined to be fixed in a later release? [2004-07-21 05:54:07] ramon_herrera at eloyalty dot com Is this a matter of compatibility versus correctness? What is the consensus among the developers/maintainers regarding this matter? Thanks again. [2004-07-20 23:23:03] [EMAIL PROTECTED] *sigh* as I mentioned again and again, whether it's correct or not doesn't matter. Personally I'm for Ilia's opinion, but compatibility should always come first. 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
#29163 [Asn]: field consisting of one space char is read as an empty string by fgetcsv
ID: 29163 User updated by: ramon_herrera at eloyalty dot com Reported By: ramon_herrera at eloyalty dot com Status: Assigned Bug Type: Filesystem function related Operating System: win2k & GNU/Linux (FC2) -PHP Version: 5.0.0 +PHP Version: 5.0.1 Assigned To: moriyoshi New Comment: This bug shows up in version 5.0.1 under Fedora Core 2. Previous Comments: [2004-08-12 08:25:01] ramon_herrera at eloyalty dot com The bug still shows up in CVS php5-200408120430 under Fedora Core 2. [2004-08-04 08:33:33] ramon_herrera at eloyalty dot com Is this bug destined to be fixed in a later release? [2004-07-21 05:54:07] ramon_herrera at eloyalty dot com Is this a matter of compatibility versus correctness? What is the consensus among the developers/maintainers regarding this matter? Thanks again. [2004-07-20 23:23:03] [EMAIL PROTECTED] *sigh* as I mentioned again and again, whether it's correct or not doesn't matter. Personally I'm for Ilia's opinion, but compatibility should always come first. [2004-07-20 23:07:08] [EMAIL PROTECTED] Current PHP 4 behavior is correct, old behavior was wrong. Opening the given file with other CVS parsers such as OpenOffice confirms that the PHP 4 behavior is correct. 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
#29163 [Asn]: field consisting of one space char is read as an empty string by fgetcsv
ID: 29163 User updated by: ramon_herrera at eloyalty dot com Reported By: ramon_herrera at eloyalty dot com Status: Assigned Bug Type: Filesystem function related Operating System: win2k & GNU/Linux (FC2) PHP Version: 5.0.0 Assigned To: moriyoshi New Comment: The bug still shows up in CVS php5-200408120430 under Fedora Core 2. Previous Comments: [2004-08-04 08:33:33] ramon_herrera at eloyalty dot com Is this bug destined to be fixed in a later release? [2004-07-21 05:54:07] ramon_herrera at eloyalty dot com Is this a matter of compatibility versus correctness? What is the consensus among the developers/maintainers regarding this matter? Thanks again. [2004-07-20 23:23:03] [EMAIL PROTECTED] *sigh* as I mentioned again and again, whether it's correct or not doesn't matter. Personally I'm for Ilia's opinion, but compatibility should always come first. [2004-07-20 23:07:08] [EMAIL PROTECTED] Current PHP 4 behavior is correct, old behavior was wrong. Opening the given file with other CVS parsers such as OpenOffice confirms that the PHP 4 behavior is correct. [2004-07-20 22:53:59] ramon_herrera at eloyalty dot com The version 4.3.8 fgetcsv() works fine. It reads a single space character from a CSV field containing a single space character. If that is what my data is then that is exactly what I want fgetcsv() to read. The version 5.0.0 fgetcsv() drops that space character. Thank you very much for your efforts. 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
#29163 [Asn]: field consisting of one space char is read as an empty string by fgetcsv
ID: 29163 User updated by: ramon_herrera at eloyalty dot com Reported By: ramon_herrera at eloyalty dot com Status: Assigned Bug Type: Filesystem function related Operating System: win2k & GNU/Linux (FC2) PHP Version: 5.0.0 Assigned To: moriyoshi New Comment: Is this bug destined to be fixed in a later release? Previous Comments: [2004-07-21 05:54:07] ramon_herrera at eloyalty dot com Is this a matter of compatibility versus correctness? What is the consensus among the developers/maintainers regarding this matter? Thanks again. [2004-07-20 23:23:03] [EMAIL PROTECTED] *sigh* as I mentioned again and again, whether it's correct or not doesn't matter. Personally I'm for Ilia's opinion, but compatibility should always come first. [2004-07-20 23:07:08] [EMAIL PROTECTED] Current PHP 4 behavior is correct, old behavior was wrong. Opening the given file with other CVS parsers such as OpenOffice confirms that the PHP 4 behavior is correct. [2004-07-20 22:53:59] ramon_herrera at eloyalty dot com The version 4.3.8 fgetcsv() works fine. It reads a single space character from a CSV field containing a single space character. If that is what my data is then that is exactly what I want fgetcsv() to read. The version 5.0.0 fgetcsv() drops that space character. Thank you very much for your efforts. [2004-07-20 22:40:06] [EMAIL PROTECTED] The reported behaviour is inconsistent with these of older versions prior to 4.3.4. Assigning to the person who broke it. 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
#29163 [Asn]: field consisting of one space char is read as an empty string by fgetcsv
ID: 29163 User updated by: ramon_herrera at eloyalty dot com Reported By: ramon_herrera at eloyalty dot com Status: Assigned Bug Type: Filesystem function related Operating System: win2k & GNU/Linux (FC2) PHP Version: 5.0.0 Assigned To: moriyoshi New Comment: Is this a matter of compatibility versus correctness? What is the consensus among the developers/maintainers regarding this matter? Thanks again. Previous Comments: [2004-07-20 23:23:03] [EMAIL PROTECTED] *sigh* as I mentioned again and again, whether it's correct or not doesn't matter. Personally I'm for Ilia's opinion, but compatibility should always come first. [2004-07-20 23:07:08] [EMAIL PROTECTED] Current PHP 4 behavior is correct, old behavior was wrong. Opening the given file with other CVS parsers such as OpenOffice confirms that the PHP 4 behavior is correct. [2004-07-20 22:53:59] ramon_herrera at eloyalty dot com The version 4.3.8 fgetcsv() works fine. It reads a single space character from a CSV field containing a single space character. If that is what my data is then that is exactly what I want fgetcsv() to read. The version 5.0.0 fgetcsv() drops that space character. Thank you very much for your efforts. [2004-07-20 22:40:06] [EMAIL PROTECTED] The reported behaviour is inconsistent with these of older versions prior to 4.3.4. Assigning to the person who broke it. [2004-07-15 18:07:12] ramon_herrera at eloyalty dot com Version 4.3.8 results are identical to the version 4.3.7 results. 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
#29163 [Asn]: field consisting of one space char is read as an empty string by fgetcsv
ID: 29163 User updated by: ramon_herrera at eloyalty dot com Reported By: ramon_herrera at eloyalty dot com Status: Assigned Bug Type: Filesystem function related Operating System: win2k & GNU/Linux (FC2) -PHP Version: 4.3.8 +PHP Version: 5.0.0 Assigned To: iliaa New Comment: The version 4.3.8 fgetcsv() works fine. It reads a single space character from a CSV field containing a single space character. If that is what my data is then that is exactly what I want fgetcsv() to read. The version 5.0.0 fgetcsv() drops that space character. Thank you very much for your efforts. Previous Comments: [2004-07-20 22:40:06] [EMAIL PROTECTED] The reported behaviour is inconsistent with these of older versions prior to 4.3.4. Assigning to the person who broke it. [2004-07-15 18:07:12] ramon_herrera at eloyalty dot com Version 4.3.8 results are identical to the version 4.3.7 results. [2004-07-15 06:50:20] ramon_herrera at eloyalty dot com (Ignore this comment. I just needed to clarify the bug category.) [2004-07-15 06:46:49] ramon_herrera at eloyalty dot com The same results occur when running a similar CLI script on my Fedora Core 2 machine under both versions (4.3.7 and 5.0.0). [2004-07-14 22:02:00] ramon_herrera at eloyalty dot com Description: A field consisting of one space character is read as an empty string by the fgetcsv function in version 5.0.0 where the version 4.3.7 fgetcsv reads the space as it is presented. The startup .bat file and the CSV file are both listed below. ./test.bat, set to use the PHP 5.0.0 binaries \ @echo off set PHPROOT=. REM set PHPVER=4.3.7 set PHPVER=5.0.0 set PHPEXE=%PHPROOT%\bin_%PHPVER%\php.exe set PHPINI=%PHPROOT%\etc\test.ini set PHPPHP=%PHPROOT%\usr\test.php %PHPEXE% -c %PHPINI% -f %PHPPHP% / ./var/zinput.txt \ foo,bar,nextisspace, ,previsspace,last / Reproduce code: --- Expected result: D:\foo>test.bat array(1) { [0]=> array(6) { [0]=> string(3) "foo" [1]=> string(3) "bar" [2]=> string(11) "nextisspace" [3]=> string(1) " " [4]=> string(11) "previsspace" [5]=> string(4) "last" } } Tested with version 4.3.7 D:\foo> Actual result: -- D:\foo>test.bat array(1) { [0]=> array(6) { [0]=> string(3) "foo" [1]=> string(3) "bar" [2]=> string(11) "nextisspace" [3]=> string(0) "" [4]=> string(11) "previsspace" [5]=> string(4) "last" } } Tested with version 5.0.0 D:\foo> -- Edit this bug report at http://bugs.php.net/?id=29163&edit=1
#29163 [Opn]: field consisting of one space char is read as an empty string by fgetcsv
ID: 29163 User updated by: ramon_herrera at eloyalty dot com Reported By: ramon_herrera at eloyalty dot com Status: Open Bug Type: Filesystem function related Operating System: win2k & GNU/Linux (FC2) PHP Version: 5.0.0 New Comment: Version 4.3.8 results are identical to the version 4.3.7 results. Previous Comments: [2004-07-15 06:50:20] ramon_herrera at eloyalty dot com (Ignore this comment. I just needed to clarify the bug category.) [2004-07-15 06:46:49] ramon_herrera at eloyalty dot com The same results occur when running a similar CLI script on my Fedora Core 2 machine under both versions (4.3.7 and 5.0.0). [2004-07-14 22:02:00] ramon_herrera at eloyalty dot com Description: A field consisting of one space character is read as an empty string by the fgetcsv function in version 5.0.0 where the version 4.3.7 fgetcsv reads the space as it is presented. The startup .bat file and the CSV file are both listed below. ./test.bat, set to use the PHP 5.0.0 binaries \ @echo off set PHPROOT=. REM set PHPVER=4.3.7 set PHPVER=5.0.0 set PHPEXE=%PHPROOT%\bin_%PHPVER%\php.exe set PHPINI=%PHPROOT%\etc\test.ini set PHPPHP=%PHPROOT%\usr\test.php %PHPEXE% -c %PHPINI% -f %PHPPHP% / ./var/zinput.txt \ foo,bar,nextisspace, ,previsspace,last / Reproduce code: --- Expected result: D:\foo>test.bat array(1) { [0]=> array(6) { [0]=> string(3) "foo" [1]=> string(3) "bar" [2]=> string(11) "nextisspace" [3]=> string(1) " " [4]=> string(11) "previsspace" [5]=> string(4) "last" } } Tested with version 4.3.7 D:\foo> Actual result: -- D:\foo>test.bat array(1) { [0]=> array(6) { [0]=> string(3) "foo" [1]=> string(3) "bar" [2]=> string(11) "nextisspace" [3]=> string(0) "" [4]=> string(11) "previsspace" [5]=> string(4) "last" } } Tested with version 5.0.0 D:\foo> -- Edit this bug report at http://bugs.php.net/?id=29163&edit=1
#29163 [Opn]: field consisting of one space char is read as an empty string by fgetcsv
ID: 29163 User updated by: ramon_herrera at eloyalty dot com Reported By: ramon_herrera at eloyalty dot com Status: Open -Bug Type: *Directory/Filesystem functions +Bug Type: Filesystem function related Operating System: win2k & GNU/Linux (FC2) PHP Version: 5.0.0 New Comment: (Ignore this comment. I just needed to clarify the bug category.) Previous Comments: [2004-07-15 06:46:49] ramon_herrera at eloyalty dot com The same results occur when running a similar CLI script on my Fedora Core 2 machine under both versions (4.3.7 and 5.0.0). [2004-07-14 22:02:00] ramon_herrera at eloyalty dot com Description: A field consisting of one space character is read as an empty string by the fgetcsv function in version 5.0.0 where the version 4.3.7 fgetcsv reads the space as it is presented. The startup .bat file and the CSV file are both listed below. ./test.bat, set to use the PHP 5.0.0 binaries \ @echo off set PHPROOT=. REM set PHPVER=4.3.7 set PHPVER=5.0.0 set PHPEXE=%PHPROOT%\bin_%PHPVER%\php.exe set PHPINI=%PHPROOT%\etc\test.ini set PHPPHP=%PHPROOT%\usr\test.php %PHPEXE% -c %PHPINI% -f %PHPPHP% / ./var/zinput.txt \ foo,bar,nextisspace, ,previsspace,last / Reproduce code: --- Expected result: D:\foo>test.bat array(1) { [0]=> array(6) { [0]=> string(3) "foo" [1]=> string(3) "bar" [2]=> string(11) "nextisspace" [3]=> string(1) " " [4]=> string(11) "previsspace" [5]=> string(4) "last" } } Tested with version 4.3.7 D:\foo> Actual result: -- D:\foo>test.bat array(1) { [0]=> array(6) { [0]=> string(3) "foo" [1]=> string(3) "bar" [2]=> string(11) "nextisspace" [3]=> string(0) "" [4]=> string(11) "previsspace" [5]=> string(4) "last" } } Tested with version 5.0.0 D:\foo> -- Edit this bug report at http://bugs.php.net/?id=29163&edit=1
#29163 [Opn]: field consisting of one space char is read as an empty string by fgetcsv
ID: 29163 User updated by: ramon_herrera at eloyalty dot com Reported By: ramon_herrera at eloyalty dot com Status: Open Bug Type: *Directory/Filesystem functions -Operating System: win2k +Operating System: win2k & GNU/Linux (FC2) PHP Version: 5.0.0 New Comment: The same results occur when running a similar CLI script on my Fedora Core 2 machine under both versions (4.3.7 and 5.0.0). Previous Comments: [2004-07-14 22:02:00] ramon_herrera at eloyalty dot com Description: A field consisting of one space character is read as an empty string by the fgetcsv function in version 5.0.0 where the version 4.3.7 fgetcsv reads the space as it is presented. The startup .bat file and the CSV file are both listed below. ./test.bat, set to use the PHP 5.0.0 binaries \ @echo off set PHPROOT=. REM set PHPVER=4.3.7 set PHPVER=5.0.0 set PHPEXE=%PHPROOT%\bin_%PHPVER%\php.exe set PHPINI=%PHPROOT%\etc\test.ini set PHPPHP=%PHPROOT%\usr\test.php %PHPEXE% -c %PHPINI% -f %PHPPHP% / ./var/zinput.txt \ foo,bar,nextisspace, ,previsspace,last / Reproduce code: --- Expected result: D:\foo>test.bat array(1) { [0]=> array(6) { [0]=> string(3) "foo" [1]=> string(3) "bar" [2]=> string(11) "nextisspace" [3]=> string(1) " " [4]=> string(11) "previsspace" [5]=> string(4) "last" } } Tested with version 4.3.7 D:\foo> Actual result: -- D:\foo>test.bat array(1) { [0]=> array(6) { [0]=> string(3) "foo" [1]=> string(3) "bar" [2]=> string(11) "nextisspace" [3]=> string(0) "" [4]=> string(11) "previsspace" [5]=> string(4) "last" } } Tested with version 5.0.0 D:\foo> -- Edit this bug report at http://bugs.php.net/?id=29163&edit=1
#29163 [NEW]: field consisting of one space char is read as an empty string by fgetcsv
From: ramon_herrera at eloyalty dot com Operating system: win2k PHP version: 5.0.0 PHP Bug Type: *Directory/Filesystem functions Bug description: field consisting of one space char is read as an empty string by fgetcsv Description: A field consisting of one space character is read as an empty string by the fgetcsv function in version 5.0.0 where the version 4.3.7 fgetcsv reads the space as it is presented. The startup .bat file and the CSV file are both listed below. ./test.bat, set to use the PHP 5.0.0 binaries \ @echo off set PHPROOT=. REM set PHPVER=4.3.7 set PHPVER=5.0.0 set PHPEXE=%PHPROOT%\bin_%PHPVER%\php.exe set PHPINI=%PHPROOT%\etc\test.ini set PHPPHP=%PHPROOT%\usr\test.php %PHPEXE% -c %PHPINI% -f %PHPPHP% / ./var/zinput.txt \ foo,bar,nextisspace, ,previsspace,last / Reproduce code: --- Expected result: D:\foo>test.bat array(1) { [0]=> array(6) { [0]=> string(3) "foo" [1]=> string(3) "bar" [2]=> string(11) "nextisspace" [3]=> string(1) " " [4]=> string(11) "previsspace" [5]=> string(4) "last" } } Tested with version 4.3.7 D:\foo> Actual result: -- D:\foo>test.bat array(1) { [0]=> array(6) { [0]=> string(3) "foo" [1]=> string(3) "bar" [2]=> string(11) "nextisspace" [3]=> string(0) "" [4]=> string(11) "previsspace" [5]=> string(4) "last" } } Tested with version 5.0.0 D:\foo> -- Edit bug report at http://bugs.php.net/?id=29163&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29163&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29163&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=29163&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=29163&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=29163&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=29163&r=needscript Try newer version: http://bugs.php.net/fix.php?id=29163&r=oldversion Not developer issue:http://bugs.php.net/fix.php?id=29163&r=support Expected behavior: http://bugs.php.net/fix.php?id=29163&r=notwrong Not enough info:http://bugs.php.net/fix.php?id=29163&r=notenoughinfo Submitted twice:http://bugs.php.net/fix.php?id=29163&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=29163&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29163&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=29163&r=dst IIS Stability: http://bugs.php.net/fix.php?id=29163&r=isapi Install GNU Sed:http://bugs.php.net/fix.php?id=29163&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=29163&r=float