如果你用模板,把模板保存为UTF-8编码,并在head中加上:<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
如果是写在Python脚本里,在开头加上: #-*- coding: utf-8 -*- 2009/4/17 tankh64 <tank...@gmail.com> > Have you tried inserting the following > > <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'> > > within your html code rather than indicate it in the response header ? > Most browsers would prioritize encoding info from the document. > Then make sure your i18n content (静态文字) is utf-8 encoded; > check your text editor on this. > > Also, your dynamically generated text content must use the same > encoding > as your main page. 希望对你有用 :) > > > On Apr 16, 11:06 am, Yuzhu <yuzhu.m...@gmail.com> wrote: > > 如果在渲染前指定self.response.headers['Content-Type']='text/ > > html;charset=utf-8' ,那么google app engine里面的数据实体的中文属性值都可以正常显示,但是页面上的静态中文 > > 则显示乱码,如:<a>链接</a>,其中的'链接'显示为乱码;但不指定self.response.headers['Content- > > Type']='text/html;charset=utf-8',页面默认也是utf-8解析,其中的'链接'字样不可以显示,如果修改浏览器字符 > > 编码格式为gb2312,静态文字可以正常显示,但是数据实体的中文属性值则显示乱码了。。怎么才能统一呢?让静态的和动态的中文都可以正常显示? > > ps:动态的是utf-8编码的,页面中的静态文字如何也使用utf-8而不是gb2312? > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---