Bug #18318 Updated: fgetcsv() cannot duel with some Chinese characters

From: Date: Fri, 12 Jul 2002 16:42:38 +0000
Subject: Bug #18318 Updated: fgetcsv() cannot duel with some Chinese characters
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-13994@lists.php.net to get a copy of this message
ID: 18318 Updated by: wytsang@cse.cuhk.edu.hk Reported By: wytsang@cse.cuhk.edu.hk Status: Open Bug Type: Filesystem function related Operating System: Windows 98 PHP Version: 4.2.1 New Comment: The eg. program of my previous post shows the bugs. The desire output is ±ç¤ÖÁø-¤k However, the actual output is ±ç¤Ö?-¤k Previous Comments: ------------------------------------------------------------------------ [2002-07-12 12:37:08] wytsang@cse.cuhk.edu.hk I find that the function fgetcsv() cannot duel with Chinese characters "Áø" and "½÷" before comma ",". I solve the problem by using fgets() and split() instead of fgetcsv(). <?php # artist.csv is a file with only one line # the line is "±ç¤ÖÁø,¤k" $fp = fopen ("artist.csv", "r"); while ($data = fgetcsv ($fp, 1000, ",")) { echo $data[0]."-".$data[1]; /* We find that the last Chinese char of $data[0] "Áø" is displayed as "?" */ } fclose($fp); ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18318&edit=1

« previous php.bugs (#13994) next »