ID: 44424 Updated by: [EMAIL PROTECTED] Reported By: yes298 at gmail dot com -Status: Open +Status: Bogus Bug Type: ICONV related Operating System: FreeBSD 7.0(x64) PHP Version: 5.2.5 New Comment:
Yes, PHP's iconv() is basically just a wrapper for the libiconv() function. And as the thing doesn't work with the iconv utility itself, it can't really be PHP bug. I suggest you report this to the iconv developers instead. Previous Comments: ------------------------------------------------------------------------ [2008-03-14 00:25:33] yes298 at gmail dot com Yes, even using freeBSD command iconv is also fail to convert between big5 and gb2312 Is it the problem of FreeBSD command libconv? I would like to know whether PHP iconv() funciton will directly call system libconv() to do convertion? ------------------------------------------------------------------------ [2008-03-13 11:53:03] [EMAIL PROTECTED] Does the same work using the command line iconv utility? ------------------------------------------------------------------------ [2008-03-13 03:06:14] yes298 at gmail dot com Description: ------------ on FreeBSD 6.2(x64) and 7.0(x64), use phpinfo() show that iconv() is enabled, but it can NOT work properly, only big5 or gb2312 convert to utf-8 is ok, but can NOT convert between big5 and gb2312 or gbk. phpinfo() result as below: iconv support enabled iconv implementation libiconv iconv library version 1.11 Directive Local Value Master Value iconv.input_encoding ISO-8859-1 ISO-8859-1 iconv.internal_encoding ISO-8859-1 ISO-8859-1 iconv.output_encoding ISO-8859-1 ISO-8859-1 Using function var_dump(get_extension_funcs("iconv")); to get info as below: array(11) { [0]=> string(5) "iconv" [1]=> string(16) "ob_iconv_handler" [2]=> string(18) "iconv_get_encoding" [3]=> string(18) "iconv_set_encoding" [4]=> string(12) "iconv_strlen" [5]=> string(12) "iconv_substr" [6]=> string(12) "iconv_strpos" [7]=> string(13) "iconv_strrpos" [8]=> string(17) "iconv_mime_encode" [9]=> string(17) "iconv_mime_decode" [10]=> string(25) "iconv_mime_decode_headers" } Reproduce code: --------------- $a = "·±ówÕfÔ~"; $b = iconv('big5','gb2312',$a); $c = iconv('big5','gbk',$a); echo 'TC: ' . $a .'<br>'; echo 'SC: ' . $b .'<br>'; echo 'gbk: ' . $c .'<br>'; Expected result: ---------------- ·±ówÕfÔ~ ·±Ìå˵´Ê ·±Ìå˵´Ê Actual result: -------------- ·±ówÕfÔ~ ·± ·± ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44424&edit=1