[英]Smarty special character issue
I used spanish language in my site. 我在网站上使用西班牙语。 when iinserted the character like í,á,é,ó it will insert properly in db,but it cannot display in front-end, it display like this in front-end 当插入í,á,é,ó之类的字符时,它将正确插入db中,但不能在前端显示,而是在前端显示如下
for example : 例如 :
Insert name : Test teachér in database it inserted correctly but in front it display as
Test teach�r.
i used <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
also but no changes at all. 我也使用了<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
但完全没有任何更改。
It has nothing to do with smarty. 它与聪明人无关。
SET NAMES utf8
检查数据库连接的字符集SET NAMES utf8
Content-type: text/html; charset="UTF-8"
or 要么
<meta charset="utf-8">
or <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta charset="utf-8">
或<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
After these operations you should have proper output. 完成这些操作后,您应该具有正确的输出。
You can also optionally check if functions that work on strings supports UTF-8. 您还可以选择检查对字符串起作用的函数是否支持UTF-8。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.