web.py中的中文字符串在网页显示乱码解决方法如下:

#!/usr/bin/env python
# encoding: utf-8
import web
urls = (
'/', 'index'
)
class index:
def GET(self):
web.header('Content-Type', 'text/html;charset=UTF-8')
return "你好!
"
if __name__ == "__main__":
app = web.application(urls, globals())
app.run() Copyright © 2009-2022 www.kswsj.com 成都快上网科技有限公司 版权所有 蜀ICP备19037934号