|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-03-13 11:53 UTC] jani@php.net
[2008-03-14 00:25 UTC] yes298 at gmail dot com
[2008-03-17 00:30 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 03:00:02 2025 UTC |
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?~ ?? ??