Icon EscapeJSON

Unit: WebCore

Available In: Client and Server Applications

function EscapeJSON(const Value: String): String

The EscapeJSON function returns the escaped version of the JSON input parameter so that the JSON can be included as part of a JSON string property value. The following characters are escaped by prefixing the characters with the backslash (\) character:

" \ / 

In addition, any non-printable characters whose ordinal value is less than the space character (' ') are escaped using the following format:

"\u<4-Digit Hex String>

The return value is a String value.

This function is the analog of the UnEscapeJSON function.

Examples

X := EscapeJSON('"Hello World"');  // X is '\"Hello World\"'
Image