Bug #12127: Function fgetcsv() lost some letters

From: Date: Fri, 13 Jul 2001 05:47:16 +0000
Subject: Bug #12127: Function fgetcsv() lost some letters
Groups: php.dev 
Request: Send a blank email to php-dev+get-59924@lists.php.net to get a copy of this message
From:             bitlz@mail.ru
Operating system: Windows 2000 Professional
PHP version:      4.0.6
PHP Bug Type:     Filesystem function related
Bug description:  Function fgetcsv() lost some letters

a.csv: ( imported from microsoft excel 2000 )

Ëþáèìîå;;;;5,58
Ëþáèìîå (âèòàìèíèçèðîâàííîå);;;345;9,15

a.php:

<?
$row = 1;
$fp = fopen ("a.csv","r");
while ($data = fgetcsv ($fp, 1000, ";")) {
    $num = count ($data);
    print "$num fields in line $row: <br>";
    $row++;
    for ($c=0; $c<$num; $c++) {
        print $data[$c]." ";
    }
    echo "<br>";
}
fclose ($fp);

?>

output from a.php:

5 fields in line 1: 
áèìîå 5,58 
5 fields in line 2: 
áèìîå (âèòàìèíèçèðîâàííîå) 345 9,15 
---------------------------------------------

some letters are lost.
-- 
Edit bug report at: http://bugs.php.net/?id=12127&edit=1



Thread (6 messages)

« previous php.dev (#59924) next »