The meta element
For HTML documents as well as XHTML documents served as text/html, the encoding should always be
specified using a meta element in
the head of the document. The
http-equiv attribute passes
information along to the user agent as though it appeared in the HTTP
header. Again, the encoding is provided with the charset value as shown here:
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Document Title</title>
</head>Although the meta element
declaring the content type is not a required element in the HTML and
XHTML DTDs, it is strongly recommended for the purpose of clearly
identifying the character encoding and keeping that information with the document. This is
particularly helpful for common text editors (such as BBEdit), which
use the meta element to identify
the character encoding of the document when opening the document for
editing. With this method, all character encodings must be explicitly
specified, including UTF-8 and UTF-16.