I need to return some special Latin letter (e.g. á
) in the response of a portlet serveResource()
method. I have tried the following ways:
response.setCharacterEncoding("ISO-8859-1") ;
PrintWriter out = resWrapper.getWriter();
out.println("á");
out.close();
OR
response.setContentType("text/plain; charset=ISO-8859-1");
PrintWriter out = resWrapper.getWriter();
out.println("á");
out.close();
The front end XHR call (to the serveResource url) does not get the correct character back from either approach above. However, if the XHR posts the request to a HttpServlet (with the exact same response codes above), it works fine.
Can someone please shed some light on the problem here?