Convert Special Characters to URL Method

The Convert Special Characters to URL method replaces special characters that a string contains with character combinations so that Siebel CRM can use the string with a URL. It returns a modified string.

Format

escape(string)

The following table describes the arguments for the Convert Special Characters to URL method.

Argument Description

string

A string that contains the characters that this method replaces.

Usage

The character combinations include Unicode values. For a character in the standard ASCII set, this is the hexadecimal ASCII code of the character preceded by a percentage symbol (%). The standard ASCII set includes decimal values 0 through 127.

The following items remain in the string:

  • Uppercase letters

  • Lowercase letters

  • Numbers

  • Ampersand (@)

  • Asterisk (*)

  • Plus sign (+)

  • Underscore (_)

  • Period (.)

  • Forward slash (/)

This method replaces other characters with their respective Unicode sequence.

Example 1

The following example encodes a string. It does not replace the ampersand (@) or asterisk (*) characters:

var str = escape("@#$*96!");

This example provides the following result:

"@%23%24*96%21"

The following example encodes a string:

var encodeStr = escape("@#$*%!");

This example provides the following result:

"@%23%24*%25%21"