Hi Bob,

I modified Neil's script (I'm no PHP scripter though so it took a little trial and error) and the code I published worked for me. My test site is on the home PC but if I recall correctly I think you need to remove any hardcoding of <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> or similar that you may have in your template / page and pull in the script as an include (baseline statement - I'm sure you're there already).

It is essential to declare the content-type in the format above, like Lachlan says :-)

For HTML 4 you will want to use <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

Try my version, maybe Neil had a typo or something?

Regards, Karl


On 16/01/06, designer <[EMAIL PROTECTED]> wrote:
Hi Karl,

An interesting piece, well done. However, it still leaves me with some
confusion.

I have been using Neil Crosby's PHP approach on [1] (see signature,
below) and it works 'OK', BUT, if I omit the meta tag:

<meta http-equiv="Content-Type" content="application/xhtml+xml;
charset=utf-8" />

from it's usual place, I get Chinese characters everywhere.  In other
words, although the PHP header puts the lang attribute and utf-8 in the
code, it won't work without the meta as well. (Not for me, anyway :-)

Why is this, do you think?

Using the PHP approach, the head section appears as follows  (stars to
highlight the offending meta tag) :

<?xml version='1.0' encoding='utf-8' ?>
      <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN'
      ' http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd '>
      <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'><head>
<title>gwelanmor internet</title>
<meta name="Keywords"
        content=" web design, flash, CSS, web standards, affordable style, minimalist, innovative, Cornwall, U.K." />
<meta name="Description"
        content=" gwelanmor Internet is a company which specialises in creating modern,standards-based, minimalist web sites at affordable rates" />
<meta content="Bob McClelland"
        name="author" />
<meta content="bob mcclelland, gwelanmor-internet"
        name="Copyright" />
<meta http-equiv="Content-Type" ********************************************************************************
        content="application/xhtml+xml; charset=utf-8" />
<link href="">        rel="stylesheet"
        type="text/css" />
</head>

Or, if IE or any browser that won't serve application/xhtml+xml, it appears as:

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN'
      ' http://www.w3.org/TR/html4/strict.dtd '>
      <html lang='en'><head>
<title>gwelanmor internet</title>
<meta name="Keywords"
        content= "web design, flash, CSS, web standards, affordable style, minimalist, innovative, Cornwall, U.K.">
<meta name="Description"
        content= "gwelanmor Internet is a company which specialises in creating modern,standards-based, minimalist web sites at affordable rates">
<meta content="Bob McClelland"
        name="author">
<meta content="bob mcclelland, gwelanmor-internet"
        name="Copyright">
<meta http-equiv="Content-Type" *****************************************************************************************************
        content="application/xhtml+xml; charset=utf-8">
<link href="">        rel="stylesheet"
        type="text/css">
</head>

Obviously, the meta tag in the IE example is simply wrong and I've
wondered about using PHP to generate the line as appropriate so this
'daft' line doesn't appear. But it doesn't seem to work without the
charset. This is why I asked yesterday about using :

<meta http-equiv="Content-Type" content="charset=utf-8" />

Lachlan says this is simply incorrect, so I'm a bit confused by all this.

--
Best Regards,

Bob McClelland

Cornwall (UK)
www.gwelanmor-internet.co.uk [1]





Karl Dawson wrote:

> Hi,
>
> Apologies in advance if you see this cross-posted:
>
> "From the Top" is a series of articles that I am publishing to
> concisely explain how and why to construct a high quality,
> web-standards compliant head section for a web page. The second
> article, just released, examines MIME and Content Negotiation.
>
> http://www.thatstandardsguy.co.uk/2006/01/16/content-negotiation/
>
> Comments, especially error-spotting and general "bravo" very welcome,
> it all helps with my work position.
>
> Regards,
> --
> Karl Dawson
> Crusader for Web Standards and Accessibility
> http://www.thatstandardsguy.co.uk
> --------------------------------------------------
> Accessites Team Member - http://www.accessites.org/
> --------------------------------------------------
>
> "The power of the Web is in its universality. Access by everyone
> regardless of disability is an essential aspect."
> Tim Berners-Lee - W3C Director and inventor of the World Wide Web


--
Best Regards,

Bob McClelland

Cornwall (UK)
www.gwelanmor-internet.co.uk


******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************




--
Karl Dawson
Crusader for Web Standards and Accessibility
http://www.thatstandardsguy.co.uk
--------------------------------------------------
Accessites Team Member - http://www.accessites.org/
--------------------------------------------------

"The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect."
Tim Berners-Lee - W3C Director and inventor of the World Wide Web

Reply via email to