There is a problem with encodeURIComponent:
After your server side script decoded the json data, it must make a “decodeURIComponent”.
Depending on what language you use, this could be a pain in the a**.
My suggestion is to use just:
—-
tData = tData.replace(/\\/g,'\\\\');
tData = tData.replace(/\”/g,'\\”');
ruleGroup += “\”data\”:\”” +