Icon EncodeURL

Unit: WebCore

Available In: Client and Server Applications

function EncodeURL(const URL: String): String

The EncodeURL function returns the encoded version of the URL input parameter. All characters are encoded except for the following:

A-Z a-z 0-9 ; , / ? : @ & = + $ - _ . ! ~ * ' ( ) #

The return value is a UTF-8-encoded String value containing percent-encoded hex strings for any encoded characters.

This function is the analog of the DecodeURL function.

Information This function is not sufficient for encoding parameter values in a URL because the ampersand (&), plus (+), and equals (=) characters are not encoded. Please see the EncodeURLComponent function for more information on encoding parameter values for inclusion in URLs.

Examples

X := EncodeURL('https://localhost/home page.html');  // X is 'https://localhost/home%20page.html'
Image