I am using PHP + HTML + smarty (as a template).
There is some dynamic content coming from user's input.
When user enters some special characters for example —.'@•
it's been saved properly in variable.
But when I try to show that same content of special character in textbox
(using smarty template) it shows something like this: . @
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> is already included in the
Header`.
I already referred this: utf-8 special characters not displaying
None of its solution worked for me.
Make sure that everything that deals with the string supports UTF-8. Mainly:
If you store the string in a table before displaying it, check that it is UTF-8 encoded (eg. for MySQL, have DEFAULT CHARSET=utf8
when you create the table).
Make sure that the view files are saved as UTF-8. In your text editor, you can normally choose the encoding. Or choose "Save as..." and choose the encoding there.
I'm not familiar with Smarty but make sure it's not converting the string to some non-UTF8 encoding.
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.