[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