Pub Pixel Avatar Image

HTML5 Snippets - Specifying Your Web Pages Character Set

Published:

Rate Article (Sign in and be the first to rate this article.)

Article Details

Views: 634

First Published:

Word Count: 293

Edition: 1

Now if you need to specify your web pages character encoding simply include the <meta> element along with the charset attribute. The charset attribute will then be used to specify the character encoding for the web page. This is done by placing your desired character encodings name, for example, the character encoding name ("UTF-8") or the character encoding name ("ISO-8859-1") as the charset attributes value.

Now let me first show you the code by itself for the HTML snippet for specifying your web pages character encoding. And then I will show you how to code and where to place the HTML snippet for both HTML5 and XHTML5.

Here is the HTML code snippet below to specify your web pages character encoding.


<meta charset="UTF-8" />

Here is the HTML code snippet to specify your web pages character encoding for HTML5 in the example below.


<!DOCTYPE html>
<html>
<head>
 <meta charset="UTF-8">
 <title>Welcome To HTML5</title>
</head>
<body>
  
 <p>The character encoding UTF-8 can represent every character in the Unicode character set.</p>  

</body>
</html>

And here is the HTML code snippet to specify your web pages character encoding for XHTML5 in the example below.


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
 <meta charset="UTF-8" />
 <title>Welcome To XHTML5</title>
</head>
<body>

 <p>The character encoding UTF-8 can represent every character in the Unicode character set.</p>  

</body>
</html>

Article Tags

Tag Article (Sign in if you want to tag this article.)

Share This Article

Send To Facebook Link

Tweet This Link

Send To LinkedIn Link

Send To StumbleUpon Link

Digg This Link

Send To Google Plus One Share Link

Send To Reddit Link

Send To Tumblr Link

Send To Delicious Link

Send To FriendFeed Link

Send To Diigo Link

Email Link

AddThis Link

0 Comments

Leave Comment (Sign in and be the first to comment on this article.)

Important

This site cannot guarantee the accuracy of articles, comments, answers and other types of content or media submitted by members or anonymous users and guests, and we recommend that you use common sense when following any advice or information found on this site. Read our full Content Disclaimer Agreement for further information.