HTML 文件
在头部添加:
<meta http-equiv="Content-Type"content="text/html; charset=utf-8"/>
例如
<head>
<meta http-equiv="Content-Type"content="text/html; charset=utf-8"/>
<title>留言板</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
PHP文件
在头部添加:
header('Content-type:text/html;charset=utf-8');
例如
<?php
header('Content-type:text/html;charset=utf-8');
?>