Forum Moderators: phranque

Message Too Old, No Replies

Useing character encoding on webpage to validate page. Please help.

What is the correct character encoding for webpages? Please help:)

         

frenzy77

8:18 am on Jun 9, 2005 (gmt 0)

10+ Year Member



Hi everybody:)

I have a few questions.

Q.1. I'm changing a site to xhtml. Do i need to use the extension .xhtml in the files or can i just leave the files with the extension .html in order for the
pages to validate?

Ex. abc.xhtml

or abc.html

>Can i just leave it as .html and will it validate?

Q.2. I tried to validate a page by file upload from my pc. The *W3C validator* said that their was no character encoding found.

>I then used the:

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />

and the page then validated for xhtml.

Q. Is the <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />

the correct one to use on the pages?

>I'm in the United States. Webpage language is English language.
>*W3C validator site has the above meta with numbers
as a recommendation if someone does not know which character encodeing to use.(western)

Q.3. Do i need to place the:
<meta http equiv="content-type" content="text/html; charset=ISO-8859-1" />
on the webpage or will the *webserver* *automatically* have it listed with the correct
character encoding?

Q.4. The pages were said to tentatively Validate as xhtml 1.0. and that there was no character encoding found. Also it did *not* display any errors.

Q. Will the correct encoding fix this problem and validate the pages when placed on the internet?

>They do validate once the:

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />

is placed in the header.

*Please answer each question.
Thank you very much everybody:)

frenzy77

bill

8:55 am on Jun 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Q.1. Do i need to use the extension .xhtml in the files?

No. .htm or .html work fine. You can use any extension you want actually, as long as your server handles it properly.

Q.2. character encoding

There are lots of good threads on WebmasterWorld about character encoding [google.com]. ISO-8859-1 is a good charset for English sites, although there are others.

Q.3. Do i need to place the:
<meta http equiv="content-type" content="text/html; charset=ISO-8859-1" />
on the webpage or will the *webserver* *automatically* have it listed?

Best to include that in every page unless you are comfortable enough to get your server to do this for you.

Q.4. Will the correct encoding fix this problem

If the pages validate offline with the charset included then they should validate online as well.

frenzy77

3:06 pm on Jun 9, 2005 (gmt 0)

10+ Year Member



Hi bill:)

Thanks for the help:)

I have a few other questions. I hope you don't mind
answering.

Do i need to include the xml declaration?
For example:
<?xml version="1.0" encoding="EUC-JP"?>

*Not this one. Just an example.

Or should i *not* include the xml declaration since i read that it may not render the document as expected.

Can i just use the:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1 transitional.dtd">

Q.2. Also you mentioned including the <!DOCTYPE html...xhtml 1.0...Transitional....>
in the header if i was'nt comfortable using
the server....

Q. If i it was done on the server, would i need to place it myself? In a file or directory?
Or would the host do this automatically on the server?
*just curious.

Thanks again for your help:)
I appreciate it.

frenzy77

bill

7:02 am on Jun 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Do i need to include the xml declaration?

Although standards say you should include this IE drops into Quirks Mode and cause more problems than it's worth. You can omit this safely.

Q. If i it was done on the server, would i need to place it myself?

I was thinking along the lines of using a server side include (SSI) to place this in every page. Regardless, this line should be a part of all your templates.