#40811 [Com]: fgetcsv() strange behaviour
ID: 40811
Comment by: crashdown at hot dot ee
Reported By: websites at mtu-net dot ru
Status: No Feedback
Bug Type: Filesystem function related
Operating System: Linux
PHP Version: 5.2.1
New Comment:
If you put cyrillic text between double-quotes, then all be okey.
Previous Comments:
------------------------------------------------------------------------
[2008-07-25 01:00:01] 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".
------------------------------------------------------------------------
[2008-07-17 16:52:16] moriyoshi@php.net
Make sure cp1251 is a supported charmap in your system. You can check
it
by feeding -a option to /usr/bin/locale .
------------------------------------------------------------------------
[2008-07-17 15:53:50] nospam at earth dot net
setlocale doesn't help.
p.csv can be any csv file under cyrillic win-1251
------------------------------------------------------------------------
[2008-07-17 15:37:38] nospam at earth dot net
code to reproduce the bug:
<?php
// setlocale(LC_ALL, 'ru_RU.cp1251');
$row = 1;
$handle = fopen("p.csv", "r");
while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) {
$num = count($data);
echo "<p> $num fields in line $row: <br /></p>\n";
$row++;
for ($c=0; $c < $num; $c++) {
echo $data[$c] . "<br />\n";
}
}
fclose($handle);
?>
------------------------------------------------------------------------
[2008-05-13 10:28:17] great_boba at yahoo dot com
Try to use setlocale
------------------------------------------------------------------------
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/40811
--
Edit this bug report at http://bugs.php.net/?id=40811&edit=1
Thread (7 messages)