#34239 [Opn->Fbk]: Iconv doesn't return expected results

From: Date: Thu, 25 Aug 2005 07:43:16 +0000
Subject: #34239 [Opn->Fbk]: Iconv doesn't return expected results
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-83969@lists.php.net to get a copy of this message
ID: 34239 Updated by: sniper@php.net Reported By: mmingxx at yahoo dot com -Status: Open +Status: Feedback Bug Type: ICONV related Operating System: Linux PHP Version: 4.4.0 New Comment: Does that work if you use the command line iconv tool? (man iconv) Previous Comments: ------------------------------------------------------------------------ [2005-08-25 05:22:51] mmingxx at yahoo dot com I obtained the following information from my php.ini file: iconv support: enabled iconv implementation: glibc iconv library version: 2.3.2 ---------- From my experience, iconv converts fine between big5 and gb2312 except for the problem that I mentioned before. ------------------------------------------------------------------------ [2005-08-24 22:56:06] sniper@php.net Are you using libiconv or glibc? Are you sure the implementation actually supports this? (it's pretty unlikely this is any bug in PHP..) ------------------------------------------------------------------------ [2005-08-24 20:18:49] mmingxx at yahoo dot com Description: ------------ Reference: string iconv ( string in_charset, string out_charset, string str ) Description: Iconv converts fine from GB2312 to Big5 if str contains only keyboard characters (e.g. 123abc@#) and GB2312 encoded characters. However, if str contains Big5 encoded characters, unexpected result would return. I tried to use append //IGNORE to the end of the out_charset but it didn't work either. Same problem exists for converting from Big5 to GB2312. Reproduce code: --------------- <? echo iconv("GB2312", "Big5//IGNORE", "Big5: ¤¤¤å¦rÅé; "); echo iconv("Big5", "GB2312//IGNORE", "GB2312: ÖÐÎÄ×ÖÌå"); ?> Expected result: ---------------- Big5: ¤¤¤å¦rÅé; GB2312: ÖÐÎÄ×ÖÌå Actual result: -------------- Big5: ¡¼¡¼r¯y; GB2312: ¡¼¡¼×ÖÌå ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34239&edit=1

« previous php.bugs (#83969) next »