ID:               30335
 Comment by:       mdv at inyourpocket dot com
 Reported By:      gruszczol1 at poczta dot onet dot pl
 Status:           No Feedback
 Bug Type:         Filesystem function related
 Operating System: linux
 PHP Version:      5.0.2
 New Comment:

it looks that fgetcsv depends on locales

<?php
$argv[1] = './x.txt';

if (!($fd = fopen($argv[1], 'r')))
        die('Can\'t open file');

while (!feof($fd))
        echo fgets($fd, 4096);

fclose($fd);

if (!($fd = fopen($argv[1], 'r')))
        die('Can\'t open file');

while (($l = fgetcsv($fd, 4096, "\t")))
        print_r($l);

fclose($fd);
?>

x.txt get here http://lampa.naut.cz/x.txt (text contains text
windows-1250 encoding "aa©\t©vvv" \t is TAB)

result when locale POSIX:
aa©    ©vvv
Array
(
    [0] => aa©
    [1] => vvv
)

result when locale cs_CZ:
aa©    ©vvv
Array
(
    [0] => aa©
    [1] => ©vvv
)


Previous Comments:
------------------------------------------------------------------------

[2004-10-16 01:00:02] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------

[2004-10-07 17:15:23] [EMAIL PROTECTED]

Try setting LC_CTYPE (or LANG) environment variable to 
"pl_PL.ISO-8859-2".

------------------------------------------------------------------------

[2004-10-07 01:38:48] [EMAIL PROTECTED]

Specific to 5.X

------------------------------------------------------------------------

[2004-10-06 11:40:37] gruszczol1 at poczta dot onet dot pl

It was tested with iso-8859-2 and windows-1250 text file.
http://republika.pl/gruszczol1/fgetcsv_bug_example.tgz

------------------------------------------------------------------------

[2004-10-06 10:32:21] [EMAIL PROTECTED]

This example is useles, as we don't know which encoding you are using.
Please put this script in a zip file and provide the link to it in this
bugreport.


------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/30335

-- 
Edit this bug report at http://bugs.php.net/?id=30335&edit=1

Reply via email to