2 Replies Latest reply on Oct 19, 2012 11:04 PM by Joe Huang-Oracle

    UTF-8 Encoding in RestServiceAdapter - problems with german mutated vowels

    Pascal B
      Hello Team!
      We've been looking into a problem with character encoding today and now came to the conclusion that it must be an internal error.

      We used your RestServiceAdapter to receive a JSON object from our REST Service (GET).
      Now we saw that in our UI, there are no mutated vowels shown, which are common in the German language. So instead of "Frühstück" or "Müsli" it showed "Fr%1/4hst%1/4ck".
      I started looking into the code, checked out the decoder but there it showed the same problems.
      So I looked at the string that is returned by the restServiceAdapter.send() method. => still the same problem

      RestServiceAdapter restServiceAdapter = Model.createRestServiceAdapter();
      restServiceAdapter.setRequestURI("Tagesgerichte/" datum + "/"); // "datum" is a string representing a date in the format yyyy-MM-dd+
      restServiceAdapter.addRequestProperty("Accept", "application/json; charset=UTF-8");
      restServiceAdapter.addRequestProperty("Content-Type", "application/json; charset=UTF-8");

      String response = "";
      +// Execute SEND and RECEIVE operation+
      +try {+
      response = restServiceAdapter.send("");

      Here, the "response" String already contains the broken letters. However, I used a couple of package analyzing tools as well as your integrated http analyzer to verify, that the service does send the correct UTF-8 encoded letters. So the only solution is the restServiceAdapter.send("") method.

      Here are two screenshots:


      Of course, there are several steps between the response String and the UI shown on the Screenshot. However, the debugger already showed the lack of mutated vowels in the said string.

      Just wanted to let you lucky americans without any weird vowels like that know that europe is having problems ;)

      Kind regards,

      Note what happens when I set encoding from UTF-8 to cp1252 in the http analyzer:


      The wrong encoding is the same as is seen in the UI.. I guess there must be something set in the Adapter, that causes this.

      Edited by: Pascal B on 16.07.2012 05:57