DecodeURLComponent

From Xojo Documentation
Jump to: navigation, search
Method

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


Syntax

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 is a series of components that are separated by component separators. They are the ".", "/", ";", "&", and "?". EncodeURLComponent works with each component part of the URL. It assumes that any component separators in a component represent text and must be encoded. An encoded URL is decoded by DecodeURLComponent.

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.


Examples

Here are examples of how an encoded URL is decoded.

Dim s as String
s = DecodeURLComponent("www.bob%26ray.com") // returns "www.bob&ray.com"
s = DecodeURLComponent(TextField1.Text, Encodings.DOSArabic))

See Also

Encodings module, EncodeURLComponent function.

Personal tools
Namespaces

Variants
Actions
Main
Content
Starting Out
Dig Deeper
More Help
Toolbox
About