Internet Direct (Indy) Version 9.0.2 Beta
TIdURI.URLEncode
Converts a US-ASCII string to a URL-Encoded string.

class function URLEncode(ASrc: string): string;
Parameters
ASrc: string
US-ASCII string to be encoded.

Returns
String - URL-encoded representation of the string.

Description
URLEncode is a String class function that converts a US-ASCII string to its representation in the URL Encoding scheme. URLEncode is based on the URL character encoding rules as described in the Internet Standards document Uniform Resource Locators (URL), RFC 1738 .

URLEncode performs special handling for characters deemed unsafe in the URL encoding scheme, and any graphical US-ASCII characters in the range 80-FF hexadecimal. The characters are converted to the character triplet consisting of the "%" character followed by the two-digit hexadecimal value for the octet.

Use URLDecode to return a URL-encoded string to its US-ASCII representation.