encodeURI(uri)
var uri="my test.php?name=ståle&car=saab";
document.write(encodeURI(uri)+ "<br>");
decodeURI(uri)
var uri="my test.asp?name=ståle&car=saab";
document.write(encodeURI(uri)+ "<br>");
document.write(decodeURI(uri));
my%20test.php?name=st%C3%A5le&car=saab
my test.asp?name=ståle&car=saab