EncodeURLComponent

From Xojo Documentation

Method

Encodes the unsafe characters of a URL.

Usage

result = EncodeURLComponent(str)

Part Type Description
result String The encoded string.
str String The string to be encoded.

Notes

A valid URL consists of alphanumerics, special characters and some reserved characters. Use EncodeURLComponent to convert any unsafe characters so they can be properly used in a URL.

The reverse operation is done by DecodeURLComponent.

Sample Code

Here is an example of how an embedded component separator is encoded.

Var s As String
s = EncodeURLComponent("www.bob&jane.com")
// s is "www.bob%26jane.com"

See Also

DecodeURLComponent.