The following method sends a JSON reply. However on the receiving end I keep getting invalid characters, and UTF-8 isn\'t decoding the data. What am I doing wrong?
Use the following code to encode
response.setCharacterEncoding("UTF8"); // this line solves the problem response.setContentType("application/json");