search

Home  >  Q&A  >  body text

PHP programs written using Sublimt txt3 are displayed as garbled Chinese characters in the browser?

I am a beginner. I initially used the txt that comes with the windows system to write code. Because default_charset = "gb2312" has been configured in php.ini, Chinese can be displayed normally. I have learned to use Sublimt txt3 to write code in the past two days. It is indeed very convenient, but there is a problem. Although the software chooses to save using utf-8, the Chinese characters in the browser display garbled characters. If I use txt to write, it can be displayed normally. ! I also found a solution online, which is to add a character setting code to the code, but does anyone know how to set Sublimt so that it can be written like the code written in txt and display Chinese directly?


不痛的石头不痛的石头2619 days ago1404

reply all(6)I'll reply

  • myfey

    myfey2017-11-27 14:01:05

    The file encoding is wrong. The file encoding should be changed to ANSI Chinese encoding format. .

    reply
    0
  • 给你买辣条

    给你买辣条2017-11-25 10:59:05

    Develop a good habit of using utf8. Do not use other encodings

    reply
    0
  • 路过

    路过2017-11-25 08:24:38

    Browser settings encoding utf8

    reply
    1
  • 不痛的石头

    It is true that right-clicking on the browser and selecting UTF8 displays normally, thank you.

    不痛的石头 · 2017-11-25 09:58:26
    不痛的石头

    Go back to php.ini and change the charset to utf8, and it will display normally. After looking at Baidu, I found out that utf8 is commonly known as universal code.

    不痛的石头 · 2017-11-25 10:07:15
    路过

    Current encoding generally uses utf8

    路过 · 2017-11-25 10:08:09
  • Cancelreply