编码指南/URL 编码
外观
< 编码指南
对字符串中的特殊字符进行编码,以便在 URL 中使用
function URLEncode (sInput) if IsNull(sInput) then URLEncode = "" exit function end if URLEncode = sInput URLEncode = Replace(URLEncode, chr(0), "") URLEncode = Replace(URLEncode, "%", "%25") URLEncode = Replace(URLEncode, " ", "%20") URLEncode = Replace(URLEncode, """", "%22") URLEncode = Replace(URLEncode, "&", "%26") URLEncode = Replace(URLEncode, "'", "%27") URLEncode = Replace(URLEncode, "/", "%2F") URLEncode = Replace(URLEncode, "?", "%3F") URLEncode = Replace(URLEncode, "\", "%5C") end function
function URLEncode (sInput) Escape(sInput) end function