Wrox Programmer Forums
BOOK: Beginning HTML, XHTML, CSS, and JavaScript
This is the forum to discuss the Wrox book Beginning HTML, XHTML, CSS, and JavaScript by Jon Duckett; ISBN: 978-0-470-54070-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning HTML, XHTML, CSS, and JavaScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 9th, 2011, 03:11 PM
Posts: n/a
Post character encoding

Hello all,
I am using dreamweaver cs5. when i start a new xhtml 1.0 strict page, among the default text that appears in the page there is this line,

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Now based on the book, i typed the xml declaration as follows right in the beginning of the page

<?xml version="1.0" encoding="iso-8859-1"?>
in the first code the charset is utf-8 while in the xml declaration the the encoding is iso-8859-1. are these two different values supposed to be the same? I am asking this because in the book on page 58 and 59, in the try it out section there is an example where the encoding is iso-8859-1. so is the charset in the <meta http-equiv.... line (page 59).
Old December 11th, 2011, 02:27 PM
Authorized User
Join Date: Sep 2010
Posts: 19
Thanks: 0
Thanked 4 Times in 4 Posts

Yes they should be the same. Since your Dreamweaver is set to UTF-8, I would continue to use UTF-8 for the meta tag, and if you do include an XML Declaration it should have the same (but fewer people seem to be using the XML Declaration these days on web pages).

I'm not an expert on this, but to try and explain a bit more:

First, you need to consider the characters that you want to use on your page. iso-8859-1 is OK for Western Europan languages such as English, French and German, but if you want to deal with Japanese, Chinese, Thai, Hindi or many others the characters are not included in iso-8859-1 and you should use UTF-8.

Second, you need to know how your program is saving the code. The actual html file for the page must be saved as UTF-8 / iso-8859-1 (there is no point writing one of these in the source code if the file is not saved in that same format). In Dreamweaver, I think you go to the preferences menu, and select the New Document options from the left then you will see an option that says "Default encoding" and you probably have UTF-8 selected there. This is fine because it should save it in that format.

So what happens is that, if a file is saved in iso-8859-1 (also often known as Latin-1), but contains characters from other characters not supported in it, then they will not show up correctly (that is when you might see that diamond shape with a question mark in it).
Old December 11th, 2011, 03:07 PM
Posts: n/a
Default Thanks @bitnap

thank there @ bitnap.

i guess i should go for utf-8 encoding since there are lot of chances hindi may come into picture.

In preferences, the default encoding is already utf-8. perhaps that's why the default meta tag is utf-8.

anyway thanks once again!

Similar Threads
Thread Thread Starter Forum Replies Last Post
Encoding Will C# 2008 aka C# 3.0 0 January 11th, 2010 02:42 PM
Invalid Character in the given encoding mswin XSLT 3 November 28th, 2008 06:01 AM
encoding problem with arabic character farukcse Pro PHP 0 November 15th, 2007 04:44 PM
encoding paarupalli J2EE 0 March 2nd, 2007 04:14 AM
encoding alihussein3 Javascript How-To 1 October 28th, 2003 05:23 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.