2 回答
My pages are html5 with
<meta charset="utf-8">
Whatever metas are quite useless.
A page charset is determined by Content-type HTTP header only, which have to contain proper character set.
$mysqli->set_charset('utf8')/;charset=utf8 in PDO's DSN also ought to be used, but it seems not the issue in your case.
OK this post is a couple of weeks old but I found out where I went wrong on this.
The values stored and taken from the database where correctly set as UTF-8. The Problem was when I echo with htmlentities.
My old echo passed through: htmlentities($str, ENT_QUOTES); it didn't have 'UTF-8'
New echo passed through: htmlentities($str, ENT_QUOTES, "UTF-8"); it worked.
Ugh. The damage of a few characters.
Anyway thanks to all of those that helped.