Date: 07/16/01
- Next message: Stig Venaas: "Re: [PHP-DEV] Help on LDAP and PHP4"
- Previous message: David Rosen: "[PHP-DEV] Help you with our programming skills and experience"
- In reply to: bitlz <email protected>: "[PHP-DEV] Bug #12127: Function fgetcsv() lost some letters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
ID: 12127
User updated by: bitlz <email protected>
Reported By: bitlz <email protected>
Old Status: Closed
Status: Open
Bug Type: Filesystem function related
Operating System: Windows 2000 Professional
PHP Version: 4.0.6
New Comment:
may be. but when running my script from the command line php version ( on windows 2000 pro ) i get following:
---------------------------
X-Powered-By: PHP/4.0.6
Content-type: text/html
5 fields in line 1: <br>бимое 5,58 <br>5 fields in line 2: <br>бимое (витаминизированное) 345 9,15 <br>
----------------------------
some letters are lost. :(
codepage in a.csv - cp1251.
this bug i see on different machines:
p100 ( win95 )
pIII 700 ( win2k pro )
on linux ( debian, kernel 2.4.3, php 4.0.5 ), i see next result:
----------------------
Content-type: text/html; charset=koi8-r
5 fields in line 1: <br>Любимое 5,58 <br>5 fields in line 2: <br>Любимое (витаминизированное) 345 9,15 <br>
-----------------------
on freebsd, php 4.0.4pl1 ( apache module ), and 4.0.6 ( fastcgi ) it also work properly.
Previous Comments:
------------------------------------------------------------------------
[2001-07-13 01:57:18] rasmus <email protected>
When running your script from the command-line version of PHP I get:
5 fields in line 1:
Любимое 5,58
5 fields in line 2:
Любимое (витаминизированное) 345 9,15
ie. I see no missing characters.
------------------------------------------------------------------------
[2001-07-13 01:47:16] bitlz <email protected>
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 this bug report at http://bugs.php.net/?id=12127&edit=1
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Stig Venaas: "Re: [PHP-DEV] Help on LDAP and PHP4"
- Previous message: David Rosen: "[PHP-DEV] Help you with our programming skills and experience"
- In reply to: bitlz <email protected>: "[PHP-DEV] Bug #12127: Function fgetcsv() lost some letters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

