Internet Direct (Indy)
Home
PreviousUpNext
TIdURI.URLEncode Method

Converts a US-ASCII string to a URL-Encoded string.

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

String - URL-encoded representation of the string.

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: 

RFC 1738 - Uniform Resource Locators (URL)  

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.

      AURLString := TIdURI.URLEncode(AString);
Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.