Problema de codificación UTF-8 en Spring MVC
Tengo un bean Spring MVC y me gustaría devolver el carácter turco configurando la codificación UTF-8. pero aunque mi cadena es "şŞğĞİıçÇöÖüÜ", vuelve como "?????? çÇöÖüÜ". y también cuando miro la página de respuesta, que es la página de Internet Explorer, la codificación es iso de Europa occidental, no UTF-8.
Aquí está el código:
@RequestMapping(method=RequestMethod.GET,value="/GetMyList")
public @ResponseBody String getMyList(HttpServletRequest request, HttpServletResponse response) throws CryptoException{
String contentType= "text/html;charset=UTF-8";
response.setContentType(contentType);
try {
request.setCharacterEncoding("utf-8");
} catch (UnsupportedEncodingException ,e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
response.setCharacterEncoding("utf-8");
String str="şŞğĞİıçÇöÖüÜ";
return str;
}