web.py输出中文字符串乱码问题的解决

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()

转载于:https://www.cnblogs.com/c-x-a/p/9176396.html

你可能感兴趣的:(web.py输出中文字符串乱码问题的解决)