Kohana 3 - In View®显示无效字符
我们正在将整个网站转换为 UTF-8。在大多数情况下,我们没有遇到任何问题,但目前 ® 符号在视图中显示为无效字符,但如果该值在控制器中输出,则它会正确显示。
我们已确保在主视图中包含元属性:
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
是否有我们缺少的设置?
We are in the process of converting to UTF-8 throughout our site. For the most part we've not had any problems, but presently the ® symbol shows up in the views as an invalid character, but when if the value is output in the Controller then it is displays correctly.
We have made certain to include the meta attribute in the main view:
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
Is there a setting that we are missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的文件应采用 UTF-8 编码(UTF-8 不含 BOM,ANSI 为 UTF-8)。
注意:Kohanas 的
HTML::chars()
使用Kohana::$charset
来决定编码时使用哪个字符集,因此请使用它而不是htmlspecialchars()
。Your files should be UTF-8 encoded (UTF-8 without BOM, ANSI as UTF-8).
Note: Kohanas'
HTML::chars()
usesKohana::$charset
to decide which charset to use when encoding, so use it instead ofhtmlspecialchars()
.