zoukankan      html  css  js  c++  java
  • C# 网页编程javascript中的编码与解码 And 后台编码

    javascript中可用的编码解码函数,有如下的组合: 

    • escape(string); 
      unescape(string);
    • encodeURI(string); 
      decodeURI(string);
    • encodeURIComponent(string); 
      decodeURIComponent(string);

    他们之间的区别为:

    escape/unescape: 
    以16进制编码字符串,对空格、符号等字符用%xx编码表示,对中文等字符用%uxxxx编码表示。自javascript1.5之后,此方法已经不被推荐使用。

    encodeURI/decodeURI: 
    以UTF-8编码编码字符串,对这些字符:“ ; , / ? : @ & = + $ ”不做编码。

    encodeURIComponent/decodeURIComponent: 
    以UTF-8编码编码所有字符串。

    因为escape/unescape已经deprecated。就不说它了,encodeURI和encodeURIComponent之前的区别用实例说明:

    Aspx 后台

    HttpUtility.UrlDecode()

    HttpUtility.UrlEncode()

  • 相关阅读:
    1600802101
    Android第二次作业
    android 第一次作业
    团队作业—项目答辩
    软件工程—团队作业2.2
    软件工程—团队作业2
    软件工程—团队作业1
    第一篇博客
    Android第四次作业
    作业3
  • 原文地址:https://www.cnblogs.com/PLifeCopyDown/p/2969708.html
Copyright © 2011-2022 走看看