<meta charset="UTF-8"> 不一致。characterEncoding=utf8。utf8mb4。?characterEncoding=utf8&useUnicode=true。response.setCharacterEncoding("UTF-8")。<meta charset="UTF-8">。// Java 端
String hex = bytesToHex(str.getBytes("UTF-8"));
// JS 端
function hexToStr(hex) { ... }
十六進制僅含 0-9 A-F,傳輸過程絕不會亂碼。