EncodeURL function
Syntax
EncodeURL(URLString)
Description
Use the EncodeURL function to apply URL encoding rules, including escape characters, to the string specified by URLString. The method used to encode the URLString is the standard defined by W3C. This function returns a string that contains the encoded URL. All characters outside the Unicode Basic Latin block (U+0020 — U+007F) are encoded, with the exception of the characters in the table below which are not encoded as they may represent valid components of URL or protocol syntax. If you need to encode such characters, use the EncodeURLForQueryString function.
The following table lists the characters in the Unicode Basic Latin block that are not encoded by the URLEncode function.
| Character (Glyph) | Description (Unicode Character Name) |
|---|---|
|
! |
Exclamation mark |
|
# |
Number sign |
|
$ |
Dollar sign |
|
& |
Ampersand |
|
( |
Left parenthesis |
|
) |
Right parenthesis |
|
* |
Asterisk |
|
+ |
Plus sign |
|
, |
Comma |
|
- |
Hyphen (minus sign) |
|
. |
Period (full stop) |
|
/ |
Slash (solidus) |
|
: |
Colon |
|
; |
Semicolon |
|
= |
Equals sign |
|
? |
Question mark |
|
_ |
Underscore |
Parameters
| Parameter | Description |
|---|---|
|
URLString |
Specify the string you want encoded. This parameter takes a string value. |
Returns
An encoded string.
Example
The example below returns the following encoded URL:
http://corp.office.com/human%20resources/benefits/401kchange_home.htm?FirstName=Gunter&LastName=D%c3%9crst
&MYSTRING = EncodeURL("http://corp.office.com/hr/benefits/401k/401k_home.htm");