in template first line type code as follows:
%# -*- coding: gb2312 -*-
in controller write
response.content_type = 'text/html; charset=gb2312'
感觉到阅读代码的能力增强了,最近的问题都是通过阅读代码,修改代码,揍活代码,优雅改良,解决问题的
reference:
http://snipplr.com/view/22778/python-web-with-bottle/
%# -*- coding: gb2312 -*-
in controller write
response.content_type = 'text/html; charset=gb2312'
感觉到阅读代码的能力增强了,最近的问题都是通过阅读代码,修改代码,揍活代码,优雅改良,解决问题的
reference:
http://snipplr.com/view/22778/python-web-with-bottle/

本文介绍了如何在 Python Web 开发中使用 Bottle 框架设置正确的页面编码为 GB2312,并通过代码示例展示了具体的实现方式。
988

被折叠的 条评论
为什么被折叠?



