[精讚] [會員登入]
395

編碼的順序

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

隨機好文

vue.js component 在parent與child 傳值 component 在parent與child 傳值

python 的RE python re

tc web 問與答 Q. 填報網址 A. https://tiny.cc/tc-web Q. 出現了以下畫面, 怎麼辦 A. 建議瀏覽器開無

使用vbs設定windows 10 靜態IP setting static ip Set Adapter = GetObject("winmgmts:Win

mongo備份指令 mongodump --host localhost --port 27017 --username root --db