2
4

2 回答 2

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.

于 2013-05-21T09:34:11.067 回答
1

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.

于 2013-06-15T03:32:40.073 回答