gpt4 book ai didi

php - UTF-8 html5网页编码

转载 作者:行者123 更新时间:2023-11-28 04:39:33 24 4
gpt4 key购买 nike

我正试图掌握 UTF-8 和字符集编码的一般情况,但这很棘手

这段代码:

<?php
header('Content-type: text/html; charset=utf-8');
?>
<!doctype html>
<html lang="da">
<head>
<title>UTF-8 test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div>
<p>UTF-8 æøå tést Señor!</p>
</div>
</body>
</html>

输出:

UTF-8 ��� t�st Se�or!

本地服务器和多个公共(public)站点(所有 Apache)上的结果相同我需要更改 php 中的某些内容吗?还是 Apache ?或者我的文本编辑器? ( Notepad++ )

最佳答案

您的文本编辑器未保存为 UTF-8。

关于php - UTF-8 html5网页编码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10814573/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com