|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12127 Function fgetcsv() lost some letters
Submitted: 2001-07-13 01:47 UTC Modified: 2003-03-09 18:41 UTC
Avg. Score:4.0 ± 1.0
Reproduced:17 of 19 (89.5%)
Same Version:6 (35.3%)
Same OS:7 (41.2%)
From: bitlz at mail dot ru Assigned:
Status: No Feedback Package: Filesystem function related
PHP Version: 4.3.1 OS: Windows 2000 Professional
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2001-07-13 01:47 UTC] bitlz at mail dot ru


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-13 01:57 UTC]

 [2001-07-16 01:33 UTC] bitlz at mail dot ru

 [2002-01-07 10:35 UTC]
Can you try 4.1.1?
 [2002-01-28 10:40 UTC]
No feedback.
 [2002-01-29 02:30 UTC] bitlz at mail dot ru
on 4.1.1 all ok.
 [2002-06-06 18:33 UTC] realktulhu at icqmail dot com

 [2002-06-07 01:04 UTC] bitlz at mail dot ru
really, on latest version of php, bug is still alive :(
 [2002-06-07 03:24 UTC]
Is this also true for the latest development snapshot ?
 [2002-06-18 18:45 UTC] radio at degunino dot net
Yes, it's true! I'm loosing some russian-letters. I've tried to install old 4.1.1. and the bug partially has been gone, I've saw more letters but not all of them. =))) PLEASE FIX IT!

Using php latest on WinXP, IIS 5.
 [2002-07-08 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, 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".
 [2002-07-08 08:19 UTC] tty at tty dot ru
I tried
php 4.0.5, 4.0.6, 4.1.1, 4.1.2, 4.2.0
on Win2000AS, Win2000S, WinXP
and i saw this bug =((( 
So I had to host my script on FreeBSD server. it's not good for me, because server isn't mine.

in which version of PHP this bug will be fixed?
 [2002-08-30 13:38 UTC] terrust at mail dot ru
I have the same problem (php4.2.2 + Win2000Prof).
You can use fgets() and then explode() instead of fgetcsv()till somebody fix this bug.
 [2002-12-03 03:48 UTC] pavel dot golub at farata dot kr dot ua
I have Windows 98 SE and also have such bug. But in my case there is only one missing character - russian letter "T". I use php-4.2.3
 [2003-02-28 07:13 UTC]

 [2003-02-28 07:13 UTC]

 [2003-02-28 07:16 UTC]
Please try using this CVS snapshot:
For Windows:

I've already committed a fix for this issue.

 [2003-02-28 07:25 UTC]
And actually bug #21689 is a duplicate of this report...

 [2003-03-09 18:41 UTC]
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.

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

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()
 [2007-06-01 12:58 UTC] laus at tinevej dot dk

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

 [2008-05-11 10:21 UTC] 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-11 10:37 UTC] pienkowskip at gmail dot com
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.
 [2011-08-19 12:48 UTC] gtisza at gmail dot com
Duplicate of bug 45356?
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC