I have an application that performs an Ajax call where a string is passed to the server and the server returns a json string containing the same String, among other information. I have this application hosted on a server in Amazon Web Services (AWS) and in my local development environment.
When I pass through this call special characters (á, ñ, etc.) in the AWS environment, they return in the json as a diamond with a question mark. The mystery is that the characters are properly encoded in my local development environment.
I have this tag to encode the HTMLtemplates:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Also i got the server annotation:
@RequestMapping(value="/actualizarDestinos", produces = "application/json; charset=utf-8", method = RequestMethod.GET)
Within the tomcat configuration in web.xml, I uncommented this filter setCharacterEncodingFilter.
Any idea why the encoding fails in the AWS environment but works in my local environment? Does it have something to do with the language of the operating system?