How can I debug this garbled code? The environment uses Appserv.
Reply to discussion (solution)
If you have a Chinese character, you must add a header.
You output the gbk content on the UTF-8 page.
If you have a Chinese character, you must add a header.
How to write code?
Header ('content-type: text/html; charset = utf-8 ');
Your script file is encoded as ANSI and needs to be changed to UTF-8.
Set header ('content-type: text/html; charset = utf-8 ');
Set browser encoding
Header ('content-type: text/html; charset = utf-8 ');
It's useless to add it here.
Your script file is encoded as ANSI and needs to be changed to UTF-8.
Set header ('content-type: text/html; charset = utf-8 ');
Set browser encoding
Garbled characters after this setting
Double-click here to modify the script code
Double-click here to modify the script code
After the Chinese language is repaired, it turns into an ASCII code, or garbled characters.
That's right. you can change the garbled text displayed at this time to Chinese.
* ***** Note: You changed it to the UTF-8 bom *****
That's right. you can change the garbled text displayed at this time to Chinese.
* ***** Note: You changed it to the UTF-8 bom *****
Let me try it.
The text in the file is garbled after being changed to utf8. didn't you see it?
The encoding of the editor, browser, and program must be consistent, otherwise garbled
That's right. you can change the garbled text displayed at this time to Chinese.
* ***** Note: You changed it to the UTF-8 bom *****
Okay. thank you.
Thank you for your patience and guidance.