The data returned by flask is garbled in chrome.

the backend uses flask, to return to the front end through return. When I check it with postman, it displays Chinese normally, but when I look at the Chinese garbled in chrome, what is the problem

?
-sharp flask
from . import web
@web.route("/login")
def login():
    headers = {
        "content-type": "text/html",
    }
    return "<html><h1>HelloWorld~~~123</h1></html>", 200, headers

postman

chrome

chromeresponse

postman Chinese display is normal

chrome browser Chinese garbled

can you check the reason for me? Thank you, God

Sep.28,2021

learn more about the basics of html. Using < meta charset= "UTF-8" > to declare the html header, the browser parsing format will display normally.

    return '<html><meta charset="UTF-8"><h1>HelloWorld~~~123</h1></html>', 200, headers
Menu