Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Google App Engine java Content-Type to UTF-8

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:

  • http://groups.google.com/group/google-appengine/browse_thread/thread/68a480cb7bec869e
  • http://www.ozelwebtasarim.com/index.php/google/10004-google-app-engine-java-utf-8-character-encoding-problem
like image 272
zproxy Avatar asked Jun 06 '09 19:06

zproxy


1 Answers

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.

like image 160
Alex Martelli Avatar answered Nov 01 '22 01:11

Alex Martelli