I found that even the {code...} page in the program can be displayed normally, but why should I add the header? What are the purposes and benefits of doing so? I found that even if the program does not use
Header ("Content-type: text/html; charset = UTF-8 ");
The page can also be displayed normally, but why should I add a header? What are the purposes and benefits of doing so?
Reply content:
I found that even if the program does not use
Header ("Content-type: text/html; charset = UTF-8 ");
The page can also be displayed normally, but why should I add a header? What are the purposes and benefits of doing so?
This http header tells the browser about the types and codes of the obtained documents. If you do not send a message, the browser can only guess it by yourself. Sometimes, you can guess it,
Sometimes it cannot be guessed. Adding such a description makes it more standard. You can try to change the document to GBK encoding. Do not send such a header to see if the browser can correctly interpret it each time.