如何将Google App Engine java Content-Type设置为UTF-8 [英] How to set Google App Engine java Content-Type to UTF-8

查看:217
本文介绍了如何将Google App Engine java Content-Type设置为UTF-8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来我不能在响应头文件中发送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:

解决方案

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆