作者:手机用户2602927805 | 来源:互联网 | 2018-03-23 13:22
[PHP]代码
function GB2312toBIG5($c) {
$f = fopen(CODETABLE_DIR.$this->config['GBtoBIG5_table'], ‘r’);
$max=strlen($c)-1;
for($i = 0;$i <$max;$i++){ $h=ord($c[$i]); if($h>=160) {
$l=ord($c[$i+1]);
if($h==161 && $l==64){
$gb=” “;
} else{
fseek($f,($h-160)*510+($l-1)*2);
$gb=fread($f,2);
}
$c[$i]=$gb[0];
$c[$i+1]=$gb[1];
$i++;
}
}
$result = $c;
return $result;
}