DecodeHareScript (open)

Converts special characters as used in HareScript.

Syntax

// Core function, no LOADLIB necessary

STRING FUNCTION DecodeHareScript(STRING text)

Parameters

STRING text

String to decode

Return value

STRING

The decoded string

Description

DecodeHareScript converts HareScript encoded strings back to strings without HareScript encoded ' (single quotes), " (double quotes), \ (backslashes), \uXXXX (unicode characters) and \xXX (bytes).

Examples

// returns "alert('Johnny and Jane')"
STRING example1 := DecodeHareScript("alert(\'Johnny and Jane\')");

// returns "alert('A\n\b')"
STRING example2 := DecodeHareScript("alert(\'A\\n\\b\')");