首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

[Web基础]URI的字符构成

2012-11-23 
[Web基础]URI的字符组成uric reserved | unreserved | escaped (1) reserved | / | ? | : |

[Web基础]URI的字符组成

uric          = reserved | unreserved | escaped (1) reserved    = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |                    "$" | "," (2) unreserved  = alphanum | mark      mark        = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"(3) 除以上的字符外,均是:      escaped     = "%" hex hex      hex         = digit | "A" | "B" | "C" | "D" | "E" | "F" |                            "a" | "b" | "c" | "d" | "e" | "f"?由上述可知:当提交的表单中,含有的字符1.属于情况(3)时,需要UrlEncode;2.属于情况(1)时,需要UrlEncode,因为作为query的value部分,当然不能有reserved字符;3.属于情况(2)时,不需要UrlEncode。不过,对(2)的mark字符,有些浏览器选择性地对它们进行了UrlEncode。参考:http://www.faqs.org/rfcs/rfc2396.html

热点排行