PHP 编码有关问题

WBOY
Release: 2016-06-13 13:23:05
Original
973 people have browsed it

PHP 编码问题
用编辑器editPlus新建一个文件index.php

  echo '这是一个测试文件';



1.文件以ASCII编码保存,


在google chrom浏览器直接访问index.php,页面正常,查看浏览器识别为gbk


2.文件以utf-8编码保存,

在google chrom浏览器直接访问index.php,页面乱码,查看浏览器识别为gbk

这是否证明浏览器默认编码为GBK?

------解决方案--------------------
汉化的计算机一般都是gbk的
------解决方案--------------------

探讨

汉化的计算机一般都是gbk的

------解决方案--------------------
探讨

引用:

汉化的计算机一般都是gbk的
安装 linux 时选择中文,就是 utf-8 的

------解决方案--------------------
windows浏览器默认gbk,linux浏览器默认utf8,应该是这样的。

你需要charset告诉浏览器是什么编码的文档。
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!