Latest web development tutorials

HTML Character Set

HTML Character Set

To display an HTML page correctly, the browser must know what character set to use.

World Wide Web using a character set early ASCII. ASCII supports the numbers 0-9, the uppercase and lowercase English alphabet, and some special characters.

Complete ASCII reference manual .

Since many countries use characters are not part of ASCII, modern browser default character set is ISO-8859-1.

Complete ISO-8859-1 reference manual .

If a page using a different ISO-8859-1 character set, it should be in the <meta> tag specified.

try it


ISO character set

ISO character set is ISO (ISO) defined for different alphabets / languages ​​standard character set.

The following lists the different character sets used throughout the world:

字符集 描述 使用范围
ISO-8859-1 Latin alphabet part 1 北美、西欧、拉丁美洲、加勒比海、加拿大、非洲
ISO-8859-2 Latin alphabet part 2 东欧
ISO-8859-3 Latin alphabet part 3 SE Europe、世界语、其他杂项
ISO-8859-4 Latin alphabet part 4 斯堪的纳维亚/波罗的海(以及其他没有包括在 ISO-8859-1 中的部分)
ISO-8859-5 Latin/Cyrillic part 5 使用古代斯拉夫语字母表的语言,比如保加利亚语、白俄罗斯文、俄罗斯语、马其顿语
ISO-8859-6 Latin/Arabic part 6 使用阿拉伯字母的语言
ISO-8859-7 Latin/Greek part 7 现代希腊语,以及由希腊语衍生的数学符号
ISO-8859-8 Latin/Hebrew part 8 使用希伯来语的语言
ISO-8859-9 Latin 5 part 9 土耳其语。除了土耳其字符取代了冰岛文字,其它与 ISO-8859-1 相同。
ISO-8859-10 Latin 6 拉普兰语、日耳曼语、爱斯基摩北欧语
ISO-8859-15 Latin 9 (aka Latin 0) 与 ISO 8859-1 类似,欧元符号和其他一些字符取代了一些较少使用的符号
ISO-2022-JP Latin/Japanese part 1 日本语
ISO-2022-JP-2 Latin/Japanese part 2 日本语
ISO-2022-KR Latin/Korean part 1 韩语


Unicode standard

Because character sets listed above have limited capacity and are not compatible in multilingual environments, the Unicode standard Unicode alliance developed.

The Unicode Standard covers all the characters, punctuation, and symbols in the world.

Whatever the platform, program or language, Unicode can be processing, storage and interchange of text data.


The Unicode Consortium

The Unicode Consortium developed the Unicode standard. Their goal is to use the standard Unicode Transformation Format (UTF) to replace the existing character sets.

Unicode standard has been a success, in XML, Java, ECMAScript (JavaScript), LDAP, CORBA 3.0, WML in, Unicode has been achieved. In many operating systems and all modern browsers, Unicode also supported.

The Unicode Consortium standard of organization and leadership development cooperation, such as ISO, W3C, and ECMA.

Unicode can be compatible with different character sets. The most common way of encoding is UTF-8 and UTF-16:

字符集 描述
UTF-8 UTF8 中的字符可以是 1-4 个字节长。UTF-8 可以表示 Unicode 标准中的任意字符。UTF-8 向后兼容 ASCII。UTF-8 是网页和电子邮件的首选编码。
UTF-16 16 比特的 Unicode 转换格式是一种 Unicode 可变字符编码,能够对全部 Unicode 指令表进行编码。UTF-16 主要被用于操作系统和环境中,比如微软的 Windows 2000/XP/2003/Vista/CE 以及 Java 和 .NET 字节代码环境。

Tip: front 256 Unicode character set corresponding to character 256 in the ISO-8859-1 character.

Tip: All HTML 4 processors have support for UTF-8, and all XHTML and XML processors support UTF-8 and UTF-16!