Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does my android app read åäö but my java app doesn't(when getting data from GAE)?
    primarykey
    data
    text
    <p>I'm using Google App Engine to fetch some data. Before sending the data from GAE, I set the content type to "text/html" and the character encoding to "UTF-8". I'm certain that the characters åöä are stored correctly on the server database.</p> <p>When getting the data from my android app, everything works fine. The characters åäö are represented correctly. Here's the strange part: when getting the same data from my java app on windows, åäö gets replaced by "Ã¥" and other strange symbols. When getting the same data from my java app on a mac, åäö gets replaced by some other strange characters.</p> <p>So my question is: Why does the android app read the string correctly while the java app doesn't?</p> <p>EDIT:</p> <p>Here's how I send the string from GAE: </p> <pre><code>resp.setContentType("text/html"); resp.setCharacterEncoding("UTF-8"); resp.getWriter().println(myString); </code></pre> <p>Here's how I read it in java both on android and windows:</p> <pre><code>String response = ""; try { URL url = new URL("http://mydomain.com/blabla"); URLConnection conn = url.openConnection(); conn.setDoOutput(true); OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream()); wr.write(data); wr.flush(); BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); String line; while ((line = rd.readLine()) != null) { response += line; } wr.close(); rd.close(); } catch (Exception e) { e.printStackTrace(); } System.out.println("Response is: " + response); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload