EncodeURLComponent

From Xojo Documentation

Revision as of 15:08, 24 August 2021 by GOLone (talk | contribs) (Removed special code for iOS as it's been available there since 2020r3.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
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.