瀏覽器自動偵測編碼失敗,或頁面實際編碼與 HTTP 標頭宣告不一致(如檔案存為 UTF-8 但標頭送 Big5)。
<?php
// 必須在任何輸出之前呼叫
header("Content-Type: text/html; charset=UTF-8");
charset 需與檔案儲存編碼一致(UTF-8 / Big5 / GBK)add_header Content-Type "text/html; charset=utf-8"; 或 AddDefaultCharset utf-8SET NAMES utf8mb4<meta charset="utf-8">(放在 <head> 首行)header() 失效 → 另存為「UTF-8 無 BOM」<?php 在第 1 行第 1 字元