EncodeURIComponent

(System Library)

Description: Encodes a string so that it can be embedded as part of a Uniform Resource Indicator. (URL-encoded)
Returns: Text
Usage: Script Only.
Function Groups: String and Buffer
Related to: UnEscape | Escape
Format: System.HTTPServerInst.EncodeURIComponent(Input[, DontEscape])
Parameters:  
Input
Required text. The string to be encoded.
DontEscape

Optional text. The set of characters that should not be escaped in the result.

Defaults to -_.!~*'() if invalid.

Comments:

The input string must be UTF-8 encoded. Any character that is not a letter, a number, or included in the set of DontEscape symbols will be percent-encoded.

If you are content with the default set of DontEscape characters, you can use the wrapper:

 System.HTTPServerInst.Escape(Input)

Example:

  IF Watch(1);
  [
    InStr = "Hello(there) And.<testing>";
    OutStr = System.HTTPServerInst.EncodeURIComponent(InStr);
  ]

OutStr will contain "Hello(there)%20And.%3Ctesting%3E".