简体   繁体   中英

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

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.

It has nothing to do with smarty.

  1. Check db charset where you store data and set it to UTF-8 General CI
  2. Check charset of db connection SET NAMES utf8
  3. Check the output of script if it's in UTF you can do it with meta charset, or in headers content-type.

Content-type: text/html; charset="UTF-8"

or

<meta charset="utf-8"> or <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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM