#34239 [Opn->Fbk]: Iconv doesn't return expected results
| From: | sniper@php.net | Date: | Wed, 24 Aug 2005 20:56:08 +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-83959@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:
Are you using libiconv or glibc?
Are you sure the implementation actually supports this?
(it's pretty unlikely this is any bug in PHP..)
Previous Comments:
------------------------------------------------------------------------
[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