How can I debug this garbled code?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.