在做项目的时候需要对(Internet) Search Engine导入链接进行Keyword analysis.

Google  用的是js'encodeURI()函数,可直接用decodeURI()解码。
Baidu 则用的是:
System.Web.HttpUtility.UrlEncode("编码", System.Text.Encoding.GetEncoding("gb2312"))的编码,
解码则需要用到:
System.Web.HttpUtility.UrlDecode("%B1%E0%C2%EB", System.Text.Encoding.GetEncoding("GB2312")));
这个需要用的ASP.NET C#.以下提供一个Javascript操作进行解码的方法.

 

<script language="vbscript">
Function str2asc(strstr) 
    str2asc 
= hex(asc(strstr)) 
End Function 

Function asc2str(ascasc) 
    asc2str 
= chr(ascasc) 
End Function
</script> 

 

UrlEncode:

 ret; 

 


UrlDecode:

 ret; 



 

相关文章:

  • 2022-03-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-02
  • 2021-07-02
相关资源
相似解决方案