[精讚] [會員登入]
451

編碼的順序

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 modal 作兩個選項按鈕並導向不同頁面 vue.js modal 作兩個選項按鈕

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

apache 反向代理 80轉443轉8080 apache, proxy pass

2018 hoc 掃地機器人 掃地機器人只能打掃沒有障礙物(桌椅、牆壁)的範圍,請寫程式控制機器人打掃餐廳的所有走道, 並在清掃完畢後回到充電器。

ArrayList 想移除特定值 想移出water, 使用lambda 的方式如下 List<String> fruits = new Arr