Often encountered in the use of utf-8 and UTF8, now finally understand their use of the difference, and now to share with you, below we look at UTF8 and UTF-8 what is the difference.
"UTF-8" is the standard notation, PHP is not case-sensitive in English, so it can also be written as "Utf-8". "UTF-8" can also be the middle of "-" omitted, written as "UTF8". General procedures can be identified, but there are exceptions (the following article), in order to be strict, it is best to use the standard capitalization "UTF-8".
Only use "UTF8" (MySQL) in the database can only use "UTF8" in the MySQL command mode, can not use "utf-8", that is, in the PHP program can only use "Set names UTF8 (no small bars)", if you add "-" This line command will not take effect, but the header in PHP to add "-", because IE does not know the "UTF8", for reasons see below.
Header in PHP:
<?php header (' content-type:text/html; Charset=utf-8 ');?>//Strange: Content-tyep with a colon, chatset is an equal sign.
Static file use:
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
Summary: only the alias "UTF8" of "utf-8" can be used in MySQL, but the uppercase "UTF-8" is used elsewhere.
The specific:
Use uppercase "UTF-8" outside the Command "mysql_query (set names UTF8)".
Differences in use of UTF8 and UTF-8