<script language="javascript">
var a = encodeURI("电影");      
alert(a);
var b = decodeURI(a);
alert(b)
</script>

<?php
$a = urlencode(iconv("gb2312", "UTF-8", "电影")); //等同于javascript encodeURI("电影");
echo $a;
$b = iconv("utf-8","gb2312",urldecode("%E7%94%B5%E5%BD%B1")); //等同于javascript decodeURI("%E7%94%B5%E5%BD%B1");
echo $b;
?>

如果编码是UTF-8的话就可以直接用urlencode 或 urldecode 转换!