Description
URLEncode takes a string that contains spaces and special characters and returns an encoded version of that string that can be used as a URL for cross-platform reporting.
Overloads
URLEncode (inputString, encodingScheme)
URLEncode (inputString, encodingScheme, neverEncode)
URLEncode (inputString, encodingScheme, neverEncode, alwaysEncode)
URLEncode (inputString, encodingScheme, characterSet)
URLEncode (inputString, encodingScheme, characterSet, neverEncode)
URLEncode (inputString, encodingScheme, characterSet, neverEncode, alwaysEncode)
Arguments
inputString is a string containing the URL that you want to encode.
encodingScheme is an integer specifying the scheme that you want to use to encode the string:
0 specifies URL encoding—following RFC 1738
1 specifies HTML form encoding—following application/x-www-form-urlencoded
2 specifies user-defined encoding—only alphanumeric characters are left unencoded by default.
If encodingScheme is not specified, the default is 0 (URL encoding).
neverEncode is a string of characters that you want left untouched by the encoding process. This argument defaults to an empty string.
Note: Only the characters that have ASCII values between 0 and 127 inclusive are allowed in the string that makes up this argument.
alwaysEncode is a string of characters that you always want encoded by the encoding process. This argument defaults to an empty string.
Note:
Only the characters that have ASCII values between 0 and 127 inclusive are allowed in the string that makes up this argument.
alwaysEncode takes precedence over neverEncode if the same characters occur in both arguments.
charcaterSet is an integer specifying the character encoding (codepage) that you want to use:
If characterSet is not specified, the default is 0 (UTF-8 encoding).
Returns
A string that contains the URL-encoded version of your input string.
Action
URLEncode takes a string that contains spaces and special characters and returns an encoded version of that string that can be used as a URL for cross-platform reporting.
Examples
URLEncode ("http://your site.com", 0)
Returns http://your%20site.com
URLEncode ("http://your site.com", 0, " ")
Returns http://your site.com
URLEncode ("http://your site.com", 0, " ", ":.")
Returns http%3A//your site%2Ecom
Comments
For URL encoding, these rules apply:
Characters that are not encoded by default: A...Z a...z 0...9 $ - _ . + ! * ' ( ) , ; / ? : @ & = #
Characters that are encoded by default: everything else.
For HTML form encoding, these rules apply:
Characters that are not encoded by default: A...Z a...z 0...9 . - * _
Special characters: " " is encoded as +
Characters that are encoded by default: everything else.
For user-defined encoding, these rules apply:
Characters that are not encoded by default: A...Z a...z 0...9
Characters that are encoded by default: everything else.
Multi-character substitutions are not supported (for example, "<" to "<").