About encoding basics

Source: Internet
Author: User
About encoding basics a php file is the encoding (file attribute, default parameter) set in the compiler (eclipse), such as setting it to gb2312 and writing it in the file & lt; metahttp-equiv & quot; Content-Type & quot; content & quot; texthtml; charsetutf-8 & quot; & gt; or & nbsp; header (& about encoding basics
A php file
The encoding (file attribute, default parameter) set in the compiler (eclipse), for example, set it to gb2312.
And
Write down in the file

Or
Header ("content-type: text/html; charset = utf-8 ")
What is the relationship between them.

If I call ajax, the returned data format depends on the encoding format set by the editor, or
Header ("content-type: text/html; charset = utf-8 ")

Basic problem solving?

------ Solution --------------------
First, we need to understand the concept. encoding consists of file encoding and Output Content encoding.

1. eclipse encoding refers to file encoding.
2. the output content of html and php is UTF-8 encoded.
3. the format returned by ajax is determined by the php file output format, that is, the header ....
Note that the output encoding of the file encoding must be consistent.
In addition, if json is required, use UTF-8. if it is not possible to convert Chinese characters to iconv before output.

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.