function encodeURIComponent($text) {
  preg_match_all("/[\x81-\xfe]?./",$text,$regs);
  $rtext = "";
  foreach($regs[0] as $v) {
   $ch = iconv("gb2312","UTF-8",$v);
   $rtext .= sprintf("%%%02X%%%02X%%%02X",ord($ch[0]),ord($ch[1]),ord($ch[2]));
  }
  return $rtext;
}
$text = "时义浩维";
echo encodeURIComponent($text);