function escape(data) {
    return data.replace(reEscapeChars, singleCharReplacer);
}
Encodes all non-ASCII characters, as well as characters not valid in XML
documents using numeric hexadecimal reference (eg. `&#xfc;`).

Have a look at `escapeUTF8` if you want a more concise output at the expense
of reduced transportability.

@param data String to escape.