From: fcartegnie at nordnet dot fr
Operating system: Linux
PHP version: 4.4.0
PHP Bug Type: Unknown/Other Function
Bug description: fgetcsv lost with low or high value ascii chars
Description:
------------
fgetcsv does not handle extended ascii as separator or enclosure.
This code does not works with 0xF0 (chr 240), and/or with enclosures
(0xF1, ...) while it works with common comma/quotes.
Tested also with setting up/changing locale.
Reproduce code:
---------------
$fp = fopen("test.csv", "w");
fwrite($fp, "A\xF0B\xF0C\xF0D");
fclose($fp);
$fp = fopen("test.csv", "r");
$data = fgetcsv ($fp, 8192, '\xF0', '');
fclose($fp);
print_r($data);
Expected result:
----------------
Array
(
[0] => A
[1] => B
[2] => C
[3] => D
)
Actual result:
--------------
Array
(
[0] => AðBðCðD
)
--
Edit bug report at http://bugs.php.net/?id=34735&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34735&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=34735&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=34735&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34735&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34735&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34735&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34735&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34735&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34735&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34735&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=34735&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=34735&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34735&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34735&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34735&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34735&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34735&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34735&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34735&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34735&r=mysqlcfg