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; }