Apache 配置默认编码


找到apache配置文件 httpd.conf ,找到以下内容

#
# Specify a default charset for all content served; this enables
# interpretation of all content as UTF-8 by default.  To use the
# default browser choice (ISO-8859-1), or to allow the META tags
# in HTML content to override this choice, comment out this
# directive:
#
AddDefaultCharset UTF-8

 

  • 实践效果:windows下的配置文件没有这些内容,手动添加也没有效果 
  • 温馨提示:尽可能使用  脚本(如:PHP)来定义编码,代码如下:
<?php
header("Content-type: text/html; charset=utf-8");
?>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM