[精讚] [會員登入]
508

編碼的順序

utf8 big5

分享此文連結 //n.sfs.tw/12369

分享連結 編碼的順序@igogo
(文章歡迎轉載,務必尊重版權註明連結來源)
2018-05-13 17:19:04 最後編修
2018-05-13 16:40:33 By igogo
 

 

在 php的程式中 

先宣告 header 的編碼

<?php

header('Content-Type: text/html; charset=UTF-8');

 

可以優先於

httpd.conf中加上  

AddDefaultCharset big5

 

如此也不會因為httpd 中所設定的編碼

導到在  html中宣告

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 

依舊受 httpd的 charset 影響而沒有作用

 

從底下圖可以觀察到 response header 的確是 utf8 了

 

這樣一來 , 即使在 httpd.conf 中設定了 強制big5 

 

browser 還是會因為 header 中的編碼  決定是utf8

END

你可能感興趣的文章

編碼的順序 utf8 big5

隨機好文

centos 7 移机出現 dracut-initqueue timeout centos 7 移机出現 dracut-initqueue timeout 處理

Google sheet 建立成績單的總分及排名並提供名字下拉查詢 Google sheet, sum, rank, pull down list

google sheet 限制使用者以點選的方式填答 google sheet 限制使用者以點選的方式填答

openldap資料移到 docker 拉docker 上的 image 回來 docker pull osixia/openldap 在正在運行的openld

批次檢查tls憑證是否過期 tls憑證一年一簽, 台中市有三百多所學校, 寫成一檔案 skaps.tc.edu.tw www.skaps.tc.ed