Method

DecodeURLComponent


Description

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

Optional: 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.Text, Encodings.DOSArabic))

Compatibility

All project types on all supported operating systems.

See also

Encodings module, EncodeURLComponent function.