Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML UTF-8 Reference

HTML Unicode (UTF-8) Reference


Unicode Consortium (Unicode Consortium)

The Unicode Consortium developed the Unicode Standard. Their goal is to replace existing character sets with the standard Unicode Transformation Format (i.e., UTF, short for Unicode Transformation Format).

The Unicode Standard is a successful initiative, implemented in HTML, XML, Java, JavaScript, E-mail, ASP, and PHP. The Unicode Standard is also supported by many operating systems and all modern browsers.

The Unicode Consortium collaborates with leading standards development organizations, namely ISO, W3C, and ECMA.


Unicode Character Sets

Unicode can be implemented by different character sets. The most commonly used encodings are UTF-8 and UTF-16:

Character set Description
UTF-8 Characters in UTF-8 can be 1 to 4 bytes long. UTF-8 can represent any character in the Unicode Standard. UTF-8 is backward compatible with ASCII. UTF-8 is the preferred encoding for e-mail and web pages.
UTF-16 The 16-bit Unicode Transformation Format is a variable-length Unicode character encoding capable of encoding the entire Unicode repertoire. UTF-16 is mainly used in operating systems and environments such as Microsoft Windows, Java, and .NET.

**Tip:** The first 128 characters of Unicode (corresponding one-to-one with ASCII) are encoded using a single octet with the same binary value as ASCII, so that valid ASCII text is also valid when encoded in UTF-8.

**Tip:** All HTML 4 processors support UTF-8, and all HTML 5 and XML processors support UTF-8 and UTF-16!


HTML5 Standard: Unicode UTF-8

Because the character set size in ISO-8859 is limited and incompatible in multilingual environments, the Unicode Consortium developed the Unicode Standard.

The Unicode Standard covers (almost) all characters, punctuation marks, and symbols.

Unicode makes text processing, storage, and transport independent of platform and language.

The default character encoding in HTML-5 is UTF-8.

The following lists some of the UTF-8 character sets supported by HTML5:

Character set Decimal Hexadecimal
C0 Controls and Basic Latin (C0 Controls and Basic Latin) 0-127 0000-007F
C1 Controls and Latin-1 Supplement (C1 Controls and Latin-1 Supplement) 128-255 0080-00FF
Latin Extended-A (Latin Extended-A) 256-383 0100-017F
Latin Extended-B (Latin Extended-B) 384-591 0180-024F

If an HTML5 web page uses characters other than UTF-8, you need to specify in the tag, as follows:

Example