views:

135

answers:

1

Code:

<script type="text/javascript">  
  var uri**="%^my test**.asp?name=ståle&car=saab";
  document.write(decodeURI(uri));   
</script>

Error:

Line: 6
Error: The URI to be decoded is not a valid encoding

is there anyway of decoding the combinations like %^ before calling the actual decodeURI

A: 

That is not a valid URI. URIs aren't allowed to contain unencoded non-ASCII characters. You can't use literal %, it has to be encoded as %25.

 var uri**="%25%5Emy test**.asp?name=st%C3%A5le&car=saab";
porneL