from app import app from flask import Response @app.route("/hello_gb2312") def hello_gb2312(): headers = {"Content-Type": "text/html; charset=gb2312"} data = """
你好世界 """.encode( "gb2312" ) return Response(data, headers=headers) @app.route("/hello_gb2312_implicit") def hello_gb2312_implicit(): headers = {"Content-Type": "text/html"} data = """ 你好世界 """.encode( "gb2312" ) return Response(data, headers=headers)