From:             yes298 at gmail dot com
Operating system: FreeBSD 7.0(x64)
PHP version:      5.2.5
PHP Bug Type:     ICONV related
Bug description:  iconv() is not working

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 bug report at http://bugs.php.net/?id=44424&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=44424&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=44424&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=44424&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=44424&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=44424&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=44424&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=44424&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=44424&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=44424&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=44424&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=44424&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=44424&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=44424&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=44424&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=44424&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=44424&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=44424&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=44424&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=44424&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=44424&r=mysqlcfg

Reply via email to