The URLEncode method of the Server class applies URL encoding rules, including escape characters, to a specified string.
public string URLEncode(String str);