Character Encoding

Description

Another use for the meta element is to declare the character encoding.

Example

An example of this is shown in the following code.


<!DOCTYPE HTML>
<html>
<head>
    <title>Example</title>
    <meta name="author" content="java2s.com"/>
    <meta name="description"  content="A simple  example"/>
    <meta charset="utf-8"/>
</head><!-- w  w  w.  j ava2 s .c  om-->
<body>
   <p>This is a test.</p>
   <a href="http://java2s.com">Visit  java2s.com</a>
</body>
</html>

Click to view the demo

The charset is set to UTF-8 encoding. UTF-8 is a common character encoding.





















Home »
  HTML CSS »
    HTML »




HTML Introduction
HTML Document
HTML Section
HTML Group Content
HTML Text Marker
HTML Table
HTML Form
HTML Embed