smritimanab / carrington

Automatically exported from code.google.com/p/carrington
0 stars 0 forks source link

meta charset declarations must come before the title element #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Looking at the carringtion-jam-1.2 release, I see the follow XHTML fragment in 
the 
header/header-default.php:

----

<head profile="http://gmpg.org/xfn/11">
    <title><?php wp_title( '-', true, 'right' ); echo wp_specialchars( get_bloginfo('name'), 1 ); ?
></title>
    <meta http-equiv="content-type" content="<?php bloginfo('html_type') ?>; charset=<?php 
bloginfo('charset') ?>" />

----

The problem is that a user agent processing this page wouldn't know what 
charset to use with 
the <title> element, so it would fallback on the http/user-agent/system/user 
default. If the 
charset declaration comes first then it knows how to process the text node of 
the <title> 
element. (Meaning the <title> text content would be presented in one charset 
while the content 
in the <body> element would use the meta charset declared encoding... which 
might confuse 
someone.)

For references on this subject, don't take my word:

1. http://www.w3.org/TR/REC-html40/charset.html#doc-char-set - "META 
declarations should 
appear as early as possible in the HEAD element." (XHTML 1.0
2. http://code.google.com/p/doctype/wiki/MetaCharsetAttribute

I've lost track, but there's also a page someone in the Mozilla developer 
documentation that 
details this same information.

Original issue reported on code.google.com by soyp...@gmail.com on 22 Jul 2009 at 11:06

GoogleCodeExporter commented 8 years ago

Original comment by alexking...@gmail.com on 2 Aug 2009 at 11:38

GoogleCodeExporter commented 8 years ago

Original comment by alexking...@gmail.com on 6 Aug 2009 at 11:56