本文介紹了如何在瀏覽器中強制使用 UTF-8 編碼?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
我有用
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
但是當我進入頁面時,在瀏覽器中選擇了另一種編碼 (ISO).我嘗試通過 PHP 方法設(shè)置編碼
But when I enter the page another encoding (ISO) is chosen in browser. I have tried to set encoding by PHP method
header('Content-type: text/html; charset=utf-8');
但這也沒有幫助.所有源文件都以 UTF-8 編碼,沒有 BOM.我嘗試過的唯一解決方案是通過添加 AddDefaultCharset UTF-8
行在 .htaccess
文件中設(shè)置編碼,但是服務(wù)器上的另一個頁面沒有正確顯示.我該如何解決這個問題?
But it also didn't help. All source files are encoded in UTF-8 without BOM. The only solution which I tried and it had worked was setting encoding in .htaccess
file by adding AddDefaultCharset UTF-8
line, but then another pages on the server were not displayed correctly. How can I solve this problem?
推薦答案
禁用默認字符集:
AddDefaultCharset Off
這篇關(guān)于如何在瀏覽器中強制使用 UTF-8 編碼?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!