Understand a html code


#1

What does meta charset=“utf-8” means the webpage is using a character. I don’t understand it completely; lost at the set “utf-8”. Can someone help me understand what this code is using and why?


#2

UTF-8 is a variable width character encoding capable of encoding all 1,112,064 valid code points in Unicode using one to four 8-bit bytes. The encoding is defined by the Unicode standard, and was originally designed by Ken Thompson and Rob Pike.

https://en.wikipedia.org/wiki/UTF-8


In the early days the common character set (English language) was Windows-1252 if I recollect correctly. The character set was limited and lacked a number of characters such as left and right quotes, etc. so a web author would need to manually encode them in the source document if they are to be rendered correctly.

“Notice the quotes?”
“Notice the quotes?”

‘Notice the quotes?’
‘Notice the quotes?’

UTF-8 character encoding does away with the need for entities and lets the author write the characters directly into the source text. A common approach is to use the ALT key and numeric keypad to enter special characters.

By not using entities in one’s source text we avoid the ampersand problem, also thanks to UTF-8.

&

<p>&<p>

as opposed to the old,

&

<p>&amp;</p>

#3

Thank you.

Now I understand.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.