PHP coding problems

Source: Internet
Author: User
PHP encoding problems use editor editPlus to create a file index. php & lt ;? Php & nbsp; echo 'This is a test file'; 1. the file is saved in ASCII code and accessed directly in the googlechrom browser. php: The page is normal. check that the file identified by the browser as gbk2. is saved in UTF-8 encoding.
Use the editor editPlus to create a file index. php

Echo 'This is a test file ';



1. files are saved in ASCII encoding,


Access index. php directly in google chrom. the page is normal and the browser recognizes it as gbk.


2. Save the file in UTF-8 encoding,

Access index. php directly in google chrom. the page is garbled and the browser recognizes it as gbk.

Does this prove that the browser is encoded as GBK by default?

------ Solution --------------------
Generally, Chinese computers use gbk
------ Solution --------------------
Discussion

Generally, Chinese computers use gbk

------ Solution --------------------
Discussion

Reference:

Generally, Chinese computers use gbk
Select Chinese when installing linux, which is UTF-8

------ Solution --------------------
Windows browser uses gbk by default, and linux Browser uses utf8 by default. This should be the case.

You need charset to tell the browser what encoding the document is.

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.