ID:               30335
 Comment by:       sandyhbdev at gmail 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:

Thanks moriyoshi,
we can do it by changing LC_CTYPE vriable.
we can read unknown char. from csv if it's begining of value,too

Thank you very much


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

[2008-03-31 09:49:32] hkroger at gmail dot com

I can confirm that this still occurs on PHP 5.1.6 on Linux with
windows-1250 text files. Please open it again.

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

[2005-11-11 13:53:04] mdv at inyourpocket dot com

i tested in on php 5.0.5

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

[2005-11-11 13:49:51] mdv at inyourpocket dot com

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
)

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

[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".

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

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