#31632 [NEW]: fgetcsv() doesn't handle unicode documents correctly

From: Date: Fri, 21 Jan 2005 12:01:04 +0000
Subject: #31632 [NEW]: fgetcsv() doesn't handle unicode documents correctly
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-72585@lists.php.net to get a copy of this message
From: nickmc at codemasters dot com Operating system: Windows 2000 Professional PHP version: 4.3.9 PHP Bug Type: Filesystem function related Bug description: fgetcsv() doesn't handle unicode documents correctly Description: ------------ Reading from a unicode-encoded text file with fgetcsv() works almost as intended, but each string in the resulting array contains a space after each character. Reproduce code: --------------- The string (saved as a unicode text file, tab delimited): "hello, this is a text file 1 2 3 4 5 6" Read using: $data = fgetcsv ($fp, 1000, "\t") Expected result: ---------------- You'd expect the output to be the same as if the file was ANSI format. Actual result: -------------- Browser output from a print_r($data) (looks OK): Array ( [0] => hello, this is a text file [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 [6] => 6 ) Page HTML: Array ( [0] => h e l l o , t h i s i s a t e x t f i l e [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 [6] => 6 ) -- Edit bug report at http://bugs.php.net/?id=31632&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31632&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31632&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31632&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=31632&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=31632&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=31632&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=31632&r=needscript Try newer version: http://bugs.php.net/fix.php?id=31632&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=31632&r=support Expected behavior: http://bugs.php.net/fix.php?id=31632&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=31632&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=31632&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=31632&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31632&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=31632&r=dst IIS Stability: http://bugs.php.net/fix.php?id=31632&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=31632&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=31632&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=31632&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=31632&r=mysqlcfg

« previous php.bugs (#72585) next »