function g($num) {
if ($num > 0 && $num < 160) {
return chr($num);
}
elseif ($num < -20319 || $num > -10247) {
return "";
} else {
for ($i = count($this->d) - 1; $i >= 0; $i--) {
if ($this->d[$i][1] <= $num)
break;
}
return $this->d[$i][0];
}
}
function c($str) {
$ret = "";
for ($i = 0; $i < strlen($str); $i++) {
$p = ord(substr($str, $i, 1));
if ($p > 160) {
$q = ord(substr($str, ++ $i, 1));
$p = $p * 256 + $q -65536;
}
$ret .= $this->g($p);
}
$ret = substr($ret, 0, 1);
return $ret;
}