#31632 [Opn]: fgetcsv() doesn't handle unicode documents correctly
| From: | nickmc at codemasters dot com | Date: | Fri, 21 Jan 2005 12:07:25 +0000 |
| Subject: | #31632 [Opn]: fgetcsv() doesn't handle unicode documents correctly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-72587@lists.php.net to get a copy of this message | ||
ID: 31632
User updated by: nickmc at codemasters dot com
Reported By: nickmc at codemasters dot com
Status: Open
Bug Type: Filesystem function related
Operating System: Windows 2000 Professional
PHP Version: 4.3.9
New Comment:
I've since read that PHP has no unicode support, so I'd guess that's
the reason.
Previous Comments:
------------------------------------------------------------------------
[2005-01-21 13:01:04] nickmc at codemasters dot com
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 this bug report at http://bugs.php.net/?id=31632&edit=1