<html>
<body>
<script>
var uri="http://ziqiangxuetang.com/my test.asp?name=ståle&car=saab";
var uri_encode=encodeURIComponent(uri);
document.write(uri_encode);
document.write("<br>");
document.write(decodeURIComponent(uri_encode));
</script>
</body>
</html>