function escapeJson (string) {

    if (string.match(_escapeable))
    {
        return string.replace(_escapeable, function (a)
        {
            var c = _meta[a];
            if (typeof c === 'string') return c;
            c = a.charCodeAt();
            return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
        });
    }

    return string;
}

var _escapeable = /["\\\x00-\x1f\x7f-\x9f]/g;

var _meta = {
    '\b': '\\b',
    '\t': '\\t',
    '\n': '\\n',
    '\f': '\\f',
    '\r': '\\r',
    '"' : '\\"',
    '\\': '\\\\'
};
