how can I do to set the charset in meta tag automatically without having to manually add the value?
I am testing Kohana Framework and from what I read it automatically sets the charset when rendering the page:
Request:: $ instance-> headers ['Content-Type'] = 'text / html; charset ='. Kohana:: $ charset;
how can I do to set the charset in meta tag automatically without having to manually add the value?
<html>
<head>
<title> title </title>
<meta http-equiv="Content-Type"开发者_如何学C content="text/html; ***charset=utf-8***" />
</head>
<body>
<h1> test </h1>
</body>
</html>
Code untested:
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo htmlspecialchars(Kohana::$charset); ?>" />
精彩评论