The charset attribute is used to declare the character encoding of the document.
Note that BOM and declaration in the HTTP header take precedence over in-document declaration.
It’s good practice to declare the character encoding inside the document for situations when the document will be used locally with no HTTP header involved, and as a visual cue in the source code.
- HTML Document Representation
- W3C Recommendation