ID: 43225
Comment by: dan at expireddomain dot com
Reported By: ed at bronto dot com
Status: Open
Bug Type: Filesystem function related
Operating System: Centos
PHP Version: 5.2.4
New Comment:
Same problem on windows XP PHP version 5.2.5 on cells that contain a \
followed by double quotes (")
Previous Comments:
------------------------------------------------------------------------
[2007-11-09 14:59:11] ed at bronto dot com
Description:
------------
Using fputcsv to output a cell that ends with a \ followed by double
quotes (") causes it to not use any escape sequence. Oddly, fgetscsv is
able to parse it correctly. Unlike fgetscsv, I assume fputcsv follows
RFC 4180 and uses " as the escape character.
Reproduce code:
---------------
$row = array();
$row[] = 'a\\"';
$row[] = 'bbb';
$fp = fopen('test.csv', 'w+');
fputcsv($fp, $row);
fclose($fp);
Expected result:
----------------
expected output: "a\""",bbb
Actual result:
--------------
actual output: "a\"",bbb
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43225&edit=1