EncodeURLComponent
EncodeURLComponent Function

Method PrototypeDescription
Function EncodeURLComponent(component As String) As Stringencode part of a URL


This function encodes a component of a URL — for example, a GET parameter value — so that it can be used as part of a URL. It converts any character that has special meaning in a URL (which includes these characters: ./;&?=) into the hexadecimal equivalent, so that it can be safely used as part of a URL.

For example, if you wanted to provide the fraction "1/2" as a part of a URL, it would need to be encoded so that the slash is not interpreted as a path separator. EncodeURLComponent converts "1/2" to "1%2F2", since "%2F" is the hexadecimal representation of the slash character.

See DecodeURLComponent for the reverse operation.