Assume you have a JSON string that you are going to send as result value back to Javascript, then you need to do the following:
String dataString = stringWriter.toString();
dataString = dataString.replaceAll("\\u2028","\\\\u2028");
dataString = dataString.replaceAll("\\u2029","\\\\u2029");
Basically, you need to escape the unicode characters.
String dataString = stringWriter.toString();
dataString = dataString.replaceAll("\\u2028","\\\\u2028");
dataString = dataString.replaceAll("\\u2029","\\\\u2029");
Basically, you need to escape the unicode characters.
No comments:
Post a Comment