<script>
alert(escape("中国"))
</script>

解决方案 »

  1.   

    escape() and unescape()方法:
    The escape and unescape functions let you encode and decode strings. The escape function returns the hexadecimal encoding of an argument in the ISO Latin character set. The unescape function returns the ASCII string for the specified hexadecimal encoding value.语法如下:escape(string)unescape(string)
    These functions are used primarily with server-side JavaScript to encode and decode name/value pairs in URLs.
      

  2.   

    escape(string)是可以转换成16进制,但在JSP 里用URLDecoder.decode(string)
    转换不过来,在JSP 里没办法用unescape(string)。
    请各位高手指点!
    谢谢!!