我试图在Xampp
的窗口中运行html5
设置utf8
。
当我在没有任何样式表的情况下运行代码时,它工作得很好:
<!DOCTYPE html>
<html lang="es-ES">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>Test</title>
</head>
<body>
My Output Compañia 2014
</body>
</html>
我的输出:
My Outpul Compañia 2014
但是当我在头部添加样式表时:
<!DOCTYPE html>
<html lang="es-ES">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>Test</title>
<link rel="stylesheet" href="/test/css/style.css" type="text/css" />
</head>
<body>
My Output Compañia 2014
</body>
</html>
Utf8
字符集在输出中失败:
My Output CompaÒia 2014
有什么想法可以解决这个问题吗?我在.htaccess
中尝试使用AddDefaultCharset UTF-8
,在css
中声明utf-8
,但没有任何效果。
查看您在 styesheets 正文中设置的字体是否具有兼容的 utf 8 字符集,并且此特定字符的代码映射到字体中的同一字符。