2018年12月3日 星期一

big5碼網頁亂碼

Q. web Server更換, 原資料移到新server後, 網頁顯示亂碼

A. 新server語系要支援big5

1. OS
檢查是否有已安裝big5
# localectl list-locales | grep zh_TW
zh_TW
zh_TW.big5
zh_TW.euctw

zh_TW.utf8
已安裝. 若未安裝請安裝

2. 修改 httpd.conf
[root@mathalu html]# vi /etc/httpd/conf/httpd.conf

將 AddDefaultCharset UTF-8註解掉
# AddDefaultCharset UTF-8

3. 重啟httpd
[root@mathalu html]# systemctl restart httpd