#34239 [NEW]: Iconv doesn't return expected results

From: Date: Wed, 24 Aug 2005 18:18:50 +0000
Subject: #34239 [NEW]: Iconv doesn't return expected results
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-83952@lists.php.net to get a copy of this message
From: mmingxx at yahoo dot com Operating system: Linux PHP version: 4.4.0 PHP Bug Type: ICONV related Bug description: Iconv doesn't return expected results 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 bug report at http://bugs.php.net/?id=34239&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34239&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34239&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34239&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34239&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34239&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34239&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34239&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34239&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34239&r=support Expected behavior: http://bugs.php.net/fix.php?id=34239&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34239&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34239&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34239&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34239&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34239&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34239&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34239&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34239&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34239&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34239&r=mysqlcfg

« previous php.bugs (#83952) next »