http://www.mediawiki.org/wiki/Special:Code/MediaWiki/63993

Revision: 63993
Author:   simetrical
Date:     2010-03-21 05:12:15 +0000 (Sun, 21 Mar 2010)

Log Message:
-----------
Use <meta charset=UTF-8> in HTML5

More succinct than <meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />.  HTML5 allows it because all browsers support it
anyway -- authors would forget quotes, leading to <meta
http-equiv=Content-Type content=text/html; charset=UTF-8 />, so browsers
all treat "charset" as an attribute of <meta> that does what you expect.

Modified Paths:
--------------
    trunk/phase3/includes/OutputPage.php

Modified: trunk/phase3/includes/OutputPage.php
===================================================================
--- trunk/phase3/includes/OutputPage.php        2010-03-21 05:12:09 UTC (rev 
63992)
+++ trunk/phase3/includes/OutputPage.php        2010-03-21 05:12:15 UTC (rev 
63993)
@@ -2075,7 +2075,6 @@
                global $wgContLang, $wgUseTrackbacks, $wgStyleVersion, 
$wgHtml5, $wgWellFormedXml;
                global $wgUser, $wgRequest, $wgLang;
 
-               $this->addMeta( "http:Content-Type", "$wgMimeType; 
charset={$wgOutputEncoding}" );
                if ( $sk->commonPrintStylesheet() ) {
                        $this->addStyle( 'common/wikiprintable.css', 'print' );
                }
@@ -2117,6 +2116,7 @@
                        foreach ( $wgXhtmlNamespaces as $tag => $ns ) {
                                $htmlAttribs["xmlns:$tag"] = $ns;
                        }
+                       $this->addMeta( 'http:Content-Type', "$wgMimeType; 
charset=$wgOutputEncoding" );
                }
                $ret .= Html::element( 'html', $htmlAttribs ) . "\n";
 
@@ -2126,6 +2126,13 @@
                        $ret .= "$openHead\n";
                }
                $ret .= "<title>" . htmlspecialchars( $this->getHTMLTitle() ) . 
"</title>\n";
+
+               if ( $wgHtml5 ) {
+                       # More succinct than <meta http-equiv=Content-Type>, 
has the
+                       # same effect
+                       $ret .= Html::element( 'meta', array( 'charset' => 
$wgOutputEncoding ) ) . "\n";
+               }
+
                $ret .= implode( "\n", array(
                        $this->getHeadLinks(),
                        $this->buildCssLinks(),



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to