Science Knowings: HTML Course For Social Media

HTML Charset

From HTML Meta Tags and Semantics to HTML5 Character Sets

In this new session, we're shifting our focus from meta tags to a fundamental aspect of HTML5 character sets. Let's dive right in!

What are Character Sets?

Character sets are systems that map characters to numeric codes. They ensure that different computers and devices can correctly display text from various languages and scripts.

Why Character Sets in HTML5?

HTML5 introduced new character sets to support a wider range of global languages and symbols. These character sets enable the correct display of text across various platforms.

The Unicode Character Set

Unicode is a universal character set that encompasses almost all characters used in the world's writing systems. It assigns a unique code to each character, ensuring consistent representation across different devices.

UTF-8, UTF-16, and UTF-32

UTF-8, UTF-16, and UTF-32 are different encodings of the Unicode character set. UTF-8 is the most commonly used encoding, as it is efficient and widely supported.

ASCII Character Set

ASCII (American Standard Code for Information Interchange) is a 7-bit character set that includes English letters, numbers, and basic symbols. It is commonly used in plain text documents and programming.

ISO-8859-1 Character Set

ISO-8859-1 (Latin-1) is an 8-bit character set that supports Western European languages. It includes accented characters, symbols, and punctuation marks.

Shift JIS Character Set

Shift JIS is a double-byte character set used in Japanese computing. It combines ASCII characters with Japanese characters to support the Japanese language.

EUC-JP Character Set

EUC-JP is another double-byte character set used in Japanese computing. It is similar to Shift JIS but uses a different encoding scheme.

KOI8-R Character Set

KOI8-R is an 8-bit character set used in Russian and other Cyrillic-based languages. It includes Russian letters, symbols, and punctuation marks.

GB2312 Character Set

GB2312 is a double-byte character set used in Simplified Chinese computing. It is the predecessor to the GBK character set and supports a wide range of Chinese characters.

Big5 Character Set

Big5 is a double-byte character set used in Traditional Chinese computing. It is commonly used in Taiwan, Hong Kong, and Macau.

Macintosh Character Set

The Macintosh character set is a proprietary character set used in older Macintosh computers. It includes characters and symbols commonly used in English and other Western European languages.

Windows-1252 Character Set

Windows-1252 is a single-byte character set used in Microsoft Windows operating systems. It supports Western European languages and includes characters like accented letters and symbols.

Specifying the Character Set in HTML5

To specify the character set in HTML5, you can use the charset attribute within the meta tag or set the Content-Type HTTP header.

Meta Tag for Character Set

Example of using the meta tag to specify the character set:

<meta charset="UTF-8">

HTTP Header for Character Set

Example of setting the HTTP header for the character set:

Content-Type: text/html; charset=UTF-8

Next Up: HTML Forms

In the next session, we'll explore HTML forms, a fundamental component for user input and data collection. Follow us to learn more!