ID:               12127
 Comment by:       pienkowskip at gmail dot com
 Reported By:      bitlz at mail dot ru
 Status:           No Feedback
 Bug Type:         Filesystem function related
 Operating System: Windows 2000 Professional
 PHP Version:      4.3.1
 New Comment:

I found out that locale in shell interpreter is 'pl_PL.UTF-8', but my
Apache is using 'C' locale.
I added to script: setlocale(LC_ALL, 'pl_PL.UTF-8'); and I has no
problems with fgetcsv().
I think it should be fixed, because csv standard doesn't mention about
locales or encodings - csv is rather binary than textual.


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

[2008-05-11 10:21:51] pienkowskip at gmail dot com

it's very strange that when I run script by shell interpreter it's
works properly, but when my Apache runs it there is a problem (mentioned
above)

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

[2008-05-01 15:26:29] steve at goooooogle dot com

confirming on PHP 5.2.0-8

Csv file line:-
1,Alert Status,État de l'alerte

fgetcsv ignores the É
It only happens if É is right after the delimiter ,

Only way I got around this was to save the file as UTF8 as mention in
the earlier comment. Didnt work even with
setlocale(LC_ALL,'fr_FR.ISO-8859-1')

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

[2007-06-01 12:58:59] laus at tinevej dot dk

I got the same problem in php-5.2.2 with danish special letters (ÆØÅ)
when it is saved in iso-8859-1.
But if i save the csv files as utf-8 the problem disappears.

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

[2006-11-24 09:32:47] info at netangels dot ru

Guys

The problem still occurs even in PHP 5.2.0 and PHP 5.1.x as well as in
5.0.x but we've found a workaround.
If csv-file is in russian encoding (cp1251) then php-script should do:
setlocale(LC_ALL, "ru_RU");
BEFORE call fgetcsv() if current locale is not ru_RU. If locale is
ru_RU already, it works well on all versions of php from 4.3.x up to the
latest 5.2.0 without requiring setlocale()

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

[2003-03-09 18:41:00] [EMAIL PROTECTED]

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.



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

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/12127

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

Reply via email to