Character charset (Character Set) in HTML


In the previous article, Taimienphi.vn introduced you to icons in HTML. In the next article below Taimienphi.vn will introduce you more about character encoding (Character Set) in HTML.


To display the HTML page properly, the web browser will have to use the character encoding (Character Set). Refer to the following article of Taimienphi.vn to learn details about character encoding (HTML).

Responsive Web Design in HTML

Table of Contents:
1. What is Character Encoding?
2. The charset attribute in HTML
3. Character encoding in HTML |
4. ASCII character encoding
5. ANSI character encoding (Windows-1252)
6. ISO-8859-1 character encoding
7. UTF-8 character encoding
8. Rule CSS @charset

1. What is Character Encoding?

ASCII is the first character encoding standard (also known as character set). In ASCII code, there are 128 different alphanumeric characters used on the Internet, including numbers including 0 – 9, English letters from A – Z and some special characters such as character register with character set in html

ISO-8859-1 is the default character set for HTML 4. This character set supports 256 different character codes.

ANSI (Windows – 1252) is the original Windows character set. The ANSI encoding is identical to ISO-8859-1, except with the addition of 32 other characters.

Because ANSI and ISO-8859-1 encoding is limited, HTML 4 also supports UTF-8. UTF- 8 (Unicode) includes almost all characters and symbols in the world.

The default character encoding for HTML5 is UTF-8.

2. The charset attribute in HTML

To display the HTML page correctly, the web browser must know the character encoding used on the page.
This is specified in the tag meta:

bang ma tu tu character set in html 2

If the browser detects ISO-8859-1 on the web, it will default to ANSI.

3. Character charset (Character Set) in HTML

The following is a list of character codes used in HTML:

bang ma tu tu character set in html 3

4. ASCII character encoding

– ASCII uses values ​​from 0 to 31 (and 127) for control characters.
– ASCII uses values ​​from 32 to 126 for letters, numbers and symbols.
– ASCII does not use values ​​from 128 to 255.

5. ANSI character encoding (Windows-1252)

– ANSI character encoding similar to ASCII for values ​​from 0 to 127.
– ANSI includes exclusive character sets for values ​​from 128 to 159.
– ANSI encoding similar to UTF-8 for values ​​from 160 to 255.

6. ISO-8859-1 character encoding

– ISO-8859-1 character encoding is similar to ASCII for values ​​from 0 to 127.
– This encoding does not use values ​​from 128 to 159.
– ISO-8859-1 encoding is similar to UTF-8 for values ​​from 160 to 255.

7. UTF-8 character encoding

– UTF-8 encoding is similar to ASCII for values ​​from 0 to 127.
– UTF-8 does not use values ​​from 128 to 159.
– UTF-8 encoding is similar to ANSI and 8859-1 for values ​​from 160 to 255.
– UTF-8 continues from the value 256 with more than 10,000 different characters.

8. Rule CSS @charset

We can use the rule CSS @charset to specify the character code used in the style sheet.

For example: To set the style sheet character code to Unicode UTF-8, we use:
@charset “UTF-8”;

https://thuthuat.taimienphi.vn/bang-ma-ky-tu-character-set-rong-html-50805n.aspx
The above article Taimienphi.vn has just introduced you to the character encoding (Character Set) in HTML. In addition, if you have any questions or need answers to learn HTML, readers can leave your comments in the comment section below the article. In the next article, Taimienphi.vn will introduce you further URL in HTML nhes.

.

Add a Comment

Your email address will not be published. Required fields are marked *