What's the difference between UTF8 and UTF-8?

Source: Internet
Author: User

Not quite understand, so the internet looked for, recorded.

Content transferred from network source Sjolzy

===========================================

"UTF-8" is the standard notation, the English is not case-sensitive under windows, 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 "UTF8" can be used in MySQL database

In the MySQL command mode can only use "UTF8", 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 in PHP header is added "- Because IE does not know the "UTF8" of the bar, the reason is below.

Only use "Utf-8" in IE browser

If "UTF8" is used in IE, the page may appear blank or garbled.

But in other browsers is normal, because: the other browser by default is UTF-8 encoding, if not recognized page encoding will be used by default UTF-8 to decode, but IE's default encoding is GB2312, so the default is .... (Other browsers refer to "FireFox", "Chrome", "Opera")


Summarize  

"Utf-8" can only be used in MySQL with the alias "UTF8", but in other places use uppercase "UTF-8". 】

The specific:

Use uppercase "UTF-8" outside the Command "mysql_query (set names UTF8)".

What's the difference between UTF8 and UTF-8?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.