The URLPathEncode method of the Server class applies URL encoding rules, including escape characters, to a specified path.
public java.lang.String URLPathEncode(java.lang.String p1);