#30097 [Fbk->Opn]: fgetcsv() does not recognize Mac EOL character (\r) as the EOL marker
| From: | dbeckham at dealnews dot com | Date: | Fri, 24 Sep 2004 12:28:43 +0000 |
| Subject: | #30097 [Fbk->Opn]: fgetcsv() does not recognize Mac EOL character (\r) as the EOL marker | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-66634@lists.php.net to get a copy of this message | ||
ID: 30097
User updated by: dbeckham at dealnews dot com
Reported By: dbeckham at dealnews dot com
-Status: Feedback
+Status: Open
Bug Type: Filesystem function related
Operating System: Mac OS X 10.3.5
PHP Version: 5.0.1
New Comment:
Using "php -d auto_detect_line_endings=1" worked and I was able to
successfully read a csv file with \r line endings.
That said, wouldn't this config option be better named if it was called
"also_support_mac_line_endings"? The config option isn't needed for
Unix or PC line endings, as PHP already works out of the box (so to
speak) with them.
There are only three main types of line endings, Unix, PC and Mac. Why
are the Mac line endings singled out like this? Why do they need a
special config option to be set, just to recognize them? It's not as
if PHP only recognizes the line endings of the platform it's compiled
on.
Previous Comments:
------------------------------------------------------------------------
[2004-09-23 21:42:50] iliaa@php.net
Did you try enable automatic EOL detection.
------------------------------------------------------------------------
[2004-09-15 19:17:01] dbeckham at dealnews dot com
Description:
------------
fgetcsv() does not recognize the Macintosh EOL character (\r) as a
legitimate EOL marker for a CSV file.
Reproduce code:
---------------
Read any CSV file that uses Mac EOL markers using fgetcsv().
Expected result:
----------------
fgetcsv() should recognized Mac EOL (\r) markers as the end of a CSV
record.
Actual result:
--------------
The entire file is read as if it's a single CSV record.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30097&edit=1