开发者

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); ?>" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜