I have an app working as webservice for a webpage and when an string arrives with stress like á, é, í, ó or ú the Java app shows the letter without the stress and a question mark like instead of showing ó in appears o?
I tried with:
return Normalizer.normalize(original, Normalizer.Form.NFD).toLowerCase().replaceAll("\\s+","").replace("?","").replace("á","a").replace("é","e").replace("ó","o").replace("ú","u").replace("í","i").replace("ñ","n");
Or
return original.toLowerCase().replaceAll("\\s+","").replace("?","").replace("á","a").replace("é","e").replace("ó","o").replace("ú","u").replace("í","i").replace("ñ","n");
When I debug the app, the string arrives with the stress in the right way, but then when I print it in the console or save it in the database it appears with the question mark.
I'm using Spring as framework.
When consuming the backend, I'm using the following Content-Type application/json; charset=UTF-8.
The database is latin1-default colection, I changed to UTF8 but I get the same result.