DecodeURLComponent

From Xojo Documentation

Method

Decodes the components of a URL that were encoded by EncodeURLComponent or equivalent.

Usage

result = DecodeURLComponent(str [,enc])

Part Type Description
result String The 'original' string.
str String The encoded URL.
enc TextEncoding The TextEncoding to be used to decode str.

Notes

A valid URL consists of alphanumerics, special characters and some reserved characters. Use DecodeURLComponent to convert encoded characters back to their original values.

The optional text encoding parameter is used to specify the original encoding of the string. To specify the encoding, use the Encodings module as shown in the second example.

Sample Code

Here are examples of how an encoded URL is decoded.

Var s As String
s = DecodeURLComponent("www.bob%26ray.com") // returns "www.bob&ray.com"
s = DecodeURLComponent(TextField1.Value, Encodings.DOSArabic))

See Also

Encodings module, EncodeURLComponent function.