[精讚] [會員登入]
549

編碼的順序

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

隨機好文

download a file from spring boot controllers ownload a file from spring boot controllers

ubuntu ufw ufw 簡易筆記 原則禁止,例外開放 ufw default deny 啟動ufw sudo ufw enable 關掉

scratch3 計算得分排名 scratch3 得分排名

題庫批次匯入google表單 請先建一新試算表, 將題目轉成格式如下 並將網址列記下來, 後續的題目就是從此試算表讀出 題目 答案 選項一 選項二 選

刪除資料夾內的檔案 lambda 一行文 Arrays.stream(new File("/folder/path").