PHP does not use the iconv () function GBK to go to unicode (utf8)
Download qswhGBK file first, [url:34009v2u]http://www.blueidea.com/user/qswh/qswhGBK.zip[/url:34009v2u]
[url:34009v2u]http://www.11jn.com/qswhGBK.zip[/url:34009v2u]
[url:34009v2u]http://www.11jn.com/qswhGBK.zip[/url:34009v2u]
color=#FF0000] download, unzip qswhGBK.ra The R file gets the qswhGBK.php file and is placed in the same directory with your PHP program files. [/color]
[code].lt;?
class qswhGBK{
var $qswhData;
function qswhGBK ($filename=.quot; qswhGBK.php.quot; >). R / > for ($i=0; $i.lt; strlen ($gb); $i) {
if ($p=ord (substr ($gb, 1)); 127) (allback))
$ret.=$q;
else {
$arr=array (.Quot; htmlHex.quot;.Quot; htmlDec.quot;.Quot;.Quot); .#93; ($q);
}else
$ret.=$callback ($q);
}
}
return $ret;
>; }
function escape ($str) {
return hexdec ($str).Lt; 256? Uot;
$dec=hexdec ($str);
$bin=decbin ($dec);
$len=strlen ($bin);
$arr=array. Dechex (0x80 bindec (substr ($bin, $i-6,6)).$ret;
else
$ret=.quot;%.quot;.Dechex / > > >; < Br / >}
return $ret;
}
}[/code]
use example
[code]
.lt; (.Quot;.Lt; xmp.gt; without parameters:.Quot;.$qswh-.gt; gb2u ($words));
echo (.Quot; \n called built-in function htmlHex:.quot); />echo (.Quot; \n calls the built-in function u2utf8:.quot;.$qswh-.gt; gb2u ($words, 4));
echo (.Quot; \n calls a custom function:.Quot; >?