Correct character encoding- Html to PHP to MySql and back
I am a little mystified as to the correct usage of character encoding when using these languages. For instance if all my website pages, including my CMS where I add content are described as:
Then should all my php functions that make use of character encoding be set to UTF-8:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Further more if the above is true then should all the mysql tables that accept string data be set to a collation of:
htmlentities($string, ENT_QUOTES, "UTF-8")
htmlspecialchars($string, ENT_QUOTES, "UTF-8")
html_entity_decode($string, ENT_QUOTES, "UTF-8")
I am currently refining my site before I host it and was just wondering what to do with regards to character encoding.
Lastly, if I am retriving data from the database using a select query then should I be issuing a SET CHARACTER SET utf8 query before a SELECT query.