[Jinzan] [Login]
670

編碼的順序

“
utf8 big5
„

Full Link //n.sfs.tw/12369

Copy Link 編碼的順序@igogo
(Welcome to reprint and indicate the source when reproducing.)
2018-05-13 17:19:04 Last edition
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

You may be interested

編碼的順序 utf8 big5

random articles

java.time 時間 instant java.time

讀取特定資料夾下的xls檔 讀取特定資料夾下的xls檔

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

Spring Boot Maven wrappers maven, mvnw, build command

scratch 不重覆隨機取陣列值 隨機取數是在設計遊戲時, 很常用到的技巧 最簡單的就是使用運算積木裡的隨機取數範圍 但是, 如果我是想全部取出且不重覆,