ID:               44424
 User updated by:  yes298 at gmail dot com
 Reported By:      yes298 at gmail dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         ICONV related
 Operating System: FreeBSD 7.0(x64)
 PHP Version:      5.2.5
 New Comment:

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?


Previous Comments:
------------------------------------------------------------------------

[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

Reply via email to