AnsweredAssumed Answered

Charsets in web scripts

Question asked by lordzoster on Feb 24, 2014
Latest reply on Feb 25, 2014 by lordzoster
Hallo
I wrote a javascript web script that gets a JSON from an external web service: the JSON is encoded by PHP json_encode and is printed with a charset of UTF-8, Content-type: application/json.
Some of the values contain accented characters (Italian but even other european languages).

I'm using the AlfrescoE4Xutils.jar for performing the XHR read, XMLHttpRequest method.

If I print out in the result in an .html Freemarker Template (charset: utf-8) I get weird accented characters. Eg. è becomes ì or the like, meaning that somewhere along the path there has been somewhat an UTF-8 to Latin1 to ISO 8859-1 to UTF-8 conversion.

Somewhere I read of people having similar problems in Spring-based application, and they have been required to change Spring configuration properties.

Due to the huge number of layers involved, I admit I have no idea where to look for.
Linux env? Tomcat? Spring? Rhino? FreeMarker? AlfrescoE4Xutils.jar library?

Outcomes