There are many languages other than English being used to code Web documents, with many of them not using the ISO 8859-1 (or Latin1) character set that is utilized by Western European languages. For that reason, the W3C requires that a valid HTML 4 (or XHTML 1) document must declare the character set the document is using.
The META element can be used to declare the character set. The character set declaration should be placed before any text that might need to be displayed, and thus should be placed above the TITLE element in the document's HEAD element. Declare the current document as using the 8-bit Unicode character set:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <head>
If creating a page displayed using the English or another Western European language, you can also declare your document's character set as ISO 8859-1, as shown here:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
The UTF-8 character set includes the ISO 8859-1 character set, however, and also allows the insertion of characters from the 8-bit Unicode character set—at least one browser, Netscape 4, will not display Unicode characters unless the character set is declared as UTF-8. For more information on declaring character sets for HTML documents, see "Special Characters and Character Sets" in Appendix B.