When a user submits a special character ♠
it's stored in MySQL database as â
and if a user wants to change it instead of displaying it back as ♠
its displayed as â
how can I fix this problem so that its dsiplayed back as ♠
and saved as ♠
?
On a side note how should I save my special characters using PHP?
I'm using PHP & MySQL
That's could be a problem.
If you want to convert your special characters into entities, you have to htmlencode them twice when outputting into field value/textarea content. But it could mess with other characters - all become their entity representations - quotes, brackets and such. If it's what you're asked for - go ahead. But, in my opinion, it could be a terrible mess to edit such a text.
That's why it's better not to let users to use entities. Why can't they enter the symbol itself?
As for the special characters in your database - just use UTF-8 encoding in both database and HTML.
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.