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