I’m trying to get special characters like the German Umlaut (ä, ö, ü) working with the Google App Engine, but sadly it dosen’t work. The Eclipse text file encoding is set to UTF-8, I use <meta http-equiv="content-type" content="text/html; charset=UTF-8"> in my index.html and the web.xml is also using encoding="utf-8".
If I compile my project locally, the characters are shown correctly. If I deploy it to the google appspot the characters are shown like this: ��. I checked also the Browser encoding, this is set to UTF-8, what did I miss?
Edit
Here is a example which works locally but not online:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>ä ö ü</title>
</head>
<body>
<form name="profile" action="">
<select name="p" size="1">
<option value="1">ä</option>
<option value="2">ö</option>
</select>
</form>
</body>
Edit2
I could isolate the problem. At the start I use the google channel api to communicate with the clients. Here I write the token to the users. This is the problem. Here is the code:
I guess I have to convert to UTF-8, but where?
FileReader reader = new FileReader("index.html");
CharBuffer buffer = CharBuffer.allocate(16384);
reader.read(buffer);
reader.close();
String index = new String(buffer.array());
index = index.replaceAll("\\{\\{ token \\}\\}", token);
index = index.replaceAll("\\{\\{ user \\}\\}", account);
resp.getWriter().write(index);
Why the characters are not shown correctly online?
FileReader always uses the platform default encoding. Use