<meta charset="UTF-8">
The text in this database is written in several different languages from English to Chinese.
A lot of the 'e's have accents over them and they use funky quotes.
With no fluff, these special characters are all output to the screen as a question mark in a black diamond (except 2).
By simply wrapping the variables in utf8_encode($string)
all is well... Again except for those 2.
First question: Why do I need to use utf8_encode
if everything is already set that way?
Second question: Several entries use ♀ and ♂ (they're stored in the database just like that). These show up as simple question marks (no black diamond). It does not matter what I do to them, they will not change. I've tried every possible combination of utf8_encode
, utf8_decode
, htmlspecialchars
, and htmlspecialchars_decode
. Nothing. The ONLY solution is to change the database entry to use ♀
for ♀ for example, then without any fluff it is output right. Why?
For Chinese and Emoji, you need utf8mb4 instead of utf8.
For black diamonds, search for such in this Q&A . It says
Since you seem to be using PHP, but did not say whether you are using mysqli
or PDO
, I will refer you to PHP checklist .
If you have ♀
, then somewhere you converted the symbols into "html entities", perhaps with PHP's htmlentities()
? Don't use any conversion tools in the client, it only makes things worse.
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.