6
votes

It seems I cannot get UTF-8 encoding to be sent in the response headers. I tried using this to no avail:

resp.setHeader("Content-Encoding", "utf-8");

Does anyone know when is this bug to be fixed or is there a workaround?

References:

2
just a reminder, it looks like the default system encoding for app engine is not utf-8, so anything that relies on a default system encoding will need to be modified to use the utf-8, eg an OutputStreamReader-chrismarx

2 Answers

7
votes

Per the w3 reference, Content-Encoding is for such things as gzip, deflate, compress -- not for "how is Unicode encoded in the body". What you need is e.g.

Content-Type: text/html; charset=utf-8

i.e., the charset attribute of Content-Type.

0
votes

I added this line to the top of my jsp page (that contained the form) and the error is gone

<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>