开发者

problems with decodeURI with %^ characters

开发者 https://www.devze.com 2022-12-13 01:38 出处:网络
Code: <script type=\"text/javascript\"> var uri = \"%^my test**.asp?name=ståle&car=saab\"; document.write(decodeURI(uri));

Code:

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

Er开发者_如何学编程ror:

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?


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

 var uri="%25^my%20test.asp?name=st%C3%A5le&car=saab";
0

精彩评论

暂无评论...
验证码 换一张
取 消