如何将Google App Engine java Content-Type设置为UTF-8 [英] How to set Google App Engine java Content-Type to UTF-8
问题描述
我试过使用这个无效:
resp.setHeader(Content-Encoding,utf-8 );
有谁知道这个错误何时被修复,或者有解决方法
参考文献:
Per w3参考资料, Content-Encoding
适用于gzip,deflate,compress - - 代表体内Unicode编码的方式。您需要的是例如。
Content-Type:text / html; charset = utf-8
即 charset
属性 Content-Type
。
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
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
.
这篇关于如何将Google App Engine java Content-Type设置为UTF-8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!