I already know that utf is for “How I store it” , and it has benefit cause it has a variable length which can be useful for web.
Q#1
1) when I declare
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
is it for
-
How the html file itself is stored in my hard drive ?
-
Or – how should the document should be transmitted to the client ( every char in document will be downloaded as a utf 8 char?)
-
Or – when a user will fill a form and submit – How should the browser transmit to the server each char in the form input+html
Q#2
2) if utf-8 can contain it all , why I sometime see charset=windows-1255" ? why they don’t always use utf8 and having fun ?
The declaration of the
Content-Typecharset is an indicator to the client what charset the received text is encoded in. The client should take appropriate action with regards to the document regardless of what encoding is used, whether that is storing the raw bytes and the charset declaration, or decoding the text into a neutral charset, or whatnot.