ID: 46217
User updated by: brook73 at gmail dot com
Reported By: brook73 at gmail dot com
Status: Open
Bug Type: Filesystem function related
Operating System: Ubuntu 8.04
PHP Version: 5.2.6
New Comment:
Re:
Example of the line in csv file:
ΓΟΜ000112;Είδη
Γραφής -
Διόρθωσης///Γόμες;1.30;1.30;30
Sep 2008
00:00:00;N;ΘΡΥΛΟΣ3;ΕΑΕΕΑΕΑΕΕΑΕΑΕΑΕ
Expected result:
Debug [0/0]:Array
(
[0] => ΓΟΜ000112
[1] => Είδη
Γραφής -
Διόρθωσης///Γόμες
[2] => 1.30
[3] => 1.30
[4] => 30 Sep 2008 00:00:00
[5] => N
[6] => ΘΡΥΛΟΣ3
[7] =>
ΕΑΕΕΑΕΑΕΕΑΕΑΕΑΕ
)
Actual result
Expected result:
Debug [0/0]:Array
(
[0] => 000112
[1] => -
Διόρθωσης///Γόμες
[2] => 1.30
[3] => 1.30
[4] => 30 Sep 2008 00:00:00
[5] => N
[6] => 3
[7] =>
)
Previous Comments:
------------------------------------------------------------------------
[2008-10-02 12:20:44] brook73 at gmail dot com
Description:
------------
The "fgetcsv" function parses a file in the greek encoding
(ISO-8859-7) incorrectly - a lot of symbols are ignored.
The "setlocale" function has not helped either (we tried
setlocale(LC_ALL, 'gr_GR'), setlocale(LC_ALL, 'gr_GR.ISO-8895-7')).
Can anyone help us and explain the reason why it happens?
The PHP version is 5.2.5.
Reproduce code:
---------------
<?php
$max_line_size = 16384;
$delimiter = ";";
$f = fopen('somefile.csv', 'rb');
while (($data = fgetcsv($f, $max_line_size, $delimiter)) !== false) {
print_r($data);
}
?>
Example of the line in csv file:
ΓΟΜ000112;Είδη
Γραφής -
Διόρθωσης///Γόμες;1.30;1.30;30
Sep 2008
00:00:00;N;ΘΡΥΛΟΣ3;ΕΑΕΕΑΕΑΕΕΑΕΑΕΑΕ;
Expected result:
----------------
Debug [0/0]:Array
(
[0] => ΓΟΜ000112
[1] => Είδη
Γραφής -
Διόρθωσης///Γόμες
[2] => 1.30
[3] => 1.30
[4] => 30 Sep 2008 00:00:00
[5] => N
[6] => ΘΡΥΛΟΣ3
[7] =>
ΕΑΕΕΑΕΑΕΕΑΕΑΕΑΕ
)
Actual result:
--------------
Debug [0/0]:Array
(
[0] => 000112
[1] => -
Διόρθωσης///Γόμες
[2] => 1.30
[3] => 1.30
[4] => 30 Sep 2008 00:00:00
[5] => N
[6] => 3
[7] =>
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46217&edit=1