Hi all, I have trouble sending internationalized JSON data. Basically some
characters get lost (e.g the euro € sign).
Here is some sample code :

if (variant.getMediaType().equals(MediaType.APPLICATION_JSON)) {
        JSONObject jo = new JSONObject();
        try {
                jo.put("result", "Iñtërnâtiônàlizætiøn€");
                result = new JsonRepresentation(jo);
                // worse with the following :
                //result.setCharacterSet(CharacterSet.UTF_8);

More generally, what are the guidelines to follow (both at the javascript/client
side and at the restlet/server side) to properly exchange localized JSON data

Sample working source code (including javascript client) at:
http://liihs.univ-tlse1.fr/~bastide/JSONServer.zip
All the best

Reply via email to