'simple',
);
-/** @deprecated Since MediaWiki 1.5, this must always be set to UTF-8. */
-$wgInputEncoding = 'UTF-8';
-/** @deprecated Since MediaWiki 1.5, this must always be set to UTF-8. */
-$wgOutputEncoding = 'UTF-8';
-
/**
* Character set for use in the article edit box. Language-specific encodings
* may be defined.
* $wgOut to output the exception.
*/
function htmlHeader() {
- global $wgLogo, $wgOutputEncoding, $wgLang;
+ global $wgLogo, $wgLang;
if ( !headers_sent() ) {
header( 'HTTP/1.0 500 Internal Server Error' );
- header( 'Content-type: text/html; charset=' . $wgOutputEncoding );
+ header( 'Content-type: text/html; charset=UTF-8' );
/* Don't cache error pages! They cause no end of trouble... */
header( 'Cache-control: none' );
header( 'Pragma: nocache' );
class ExternalEdit {
function __construct( $article, $mode ) {
- global $wgInputEncoding;
$this->mArticle =& $article;
$this->mTitle =& $article->mTitle;
- $this->mCharset = $wgInputEncoding;
+ $this->mCharset = 'UTF-8';
$this->mMode = $mode;
}
public static function htmlHeader( $attribs = array() ) {
$ret = '';
- global $wgMimeType, $wgOutputEncoding;
+ global $wgMimeType;
if ( self::isXmlMimeType( $wgMimeType ) ) {
- $ret .= "<?xml version=\"1.0\" encoding=\"$wgOutputEncoding\" ?" . ">\n";
+ $ret .= "<?xml version=\"1.0\" encoding=\"UTF-8\" ?" . ">\n";
}
global $wgHtml5, $wgHtml5Version, $wgDocType, $wgDTD;
* begin of the page
*/
protected function prologue() {
- global $wgOutputEncoding;
-
$url = htmlspecialchars( $this->reallyFullUrl() );
print <<<PROLOGUE
-<?xml version="1.0" encoding="{$wgOutputEncoding}" ?>
+<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE rdf:RDF PUBLIC "-//DUBLIN CORE//DCMES DTD 2002/07/31//EN" "http://dublincore.org/documents/2002/07/31/dcmes-xml/dcmes-xml-dtd.dtd">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
}
protected function prologue() {
- global $wgOutputEncoding;
echo <<<PROLOGUE
-<?xml version='1.0' encoding="{$wgOutputEncoding}" ?>
+<?xml version='1.0' encoding="UTF-8" ?>
<rdf:RDF xmlns:cc="http://web.resource.org/cc/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
* the object, let's actually output it:
*/
public function output() {
- global $wgOutputEncoding;
global $wgLanguageCode, $wgDebugRedirects, $wgMimeType;
if( $this->mDoNothing ) {
# Buffer output; final headers may depend on later processing
ob_start();
- $response->header( "Content-type: $wgMimeType; charset={$wgOutputEncoding}" );
+ $response->header( "Content-type: $wgMimeType; charset=UTF-8" );
$response->header( 'Content-language: ' . $wgLanguageCode );
// Prevent framing, if requested
* @param $ins String: the string to output
*/
public function out( $ins ) {
- global $wgInputEncoding, $wgOutputEncoding, $wgContLang;
- if ( 0 == strcmp( $wgInputEncoding, $wgOutputEncoding ) ) {
+ global $wgContLang;
+ if ( 0 == strcmp( 'UTF-8', 'UTF-8' ) ) {
$outs = $ins;
} else {
- $outs = $wgContLang->iconv( $wgInputEncoding, $wgOutputEncoding, $ins );
+ $outs = $wgContLang->iconv( 'UTF-8', 'UTF-8', $ins );
if ( false === $outs ) {
$outs = $ins;
}
*/
public function getHeadLinks( Skin $sk, $addContentType = false ) {
global $wgUniversalEditButton, $wgFavicon, $wgAppleTouchIcon, $wgEnableAPI,
- $wgSitename, $wgVersion, $wgHtml5, $wgMimeType, $wgOutputEncoding,
+ $wgSitename, $wgVersion, $wgHtml5, $wgMimeType,
$wgFeed, $wgOverrideSiteFeed, $wgAdvertisedFeedTypes,
$wgEnableDublinCoreRdf, $wgEnableCreativeCommonsRdf,
$wgDisableLangConversion, $wgCanonicalLanguageLinks, $wgContLang,
if ( $wgHtml5 ) {
# More succinct than <meta http-equiv=Content-Type>, has the
# same effect
- $tags[] = Html::element( 'meta', array( 'charset' => $wgOutputEncoding ) );
+ $tags[] = Html::element( 'meta', array( 'charset' => 'UTF-8' ) );
} else {
$tags[] = Html::element( 'meta', array(
'http-equiv' => 'Content-Type',
- 'content' => "$wgMimeType; charset=$wgOutputEncoding"
+ 'content' => "$wgMimeType; charset=UTF-8"
) );
$tags[] = Html::element( 'meta', array( // bug 15835
'http-equiv' => 'Content-Style-Type',
var $mContentType, $mExpandTemplates;
function __construct( Article $article, $request = false ) {
- global $wgRequest, $wgInputEncoding, $wgSquidMaxage, $wgJsMimeType, $wgGroupPermissions;
+ global $wgRequest, $wgSquidMaxage, $wgJsMimeType, $wgGroupPermissions;
$allowedCTypes = array( 'text/x-wiki', $wgJsMimeType, 'text/css', 'application/x-zope-edit' );
$this->mArticle = $article;
} else {
$this->mGen = false;
}
- $this->mCharset = $wgInputEncoding;
+ $this->mCharset = 'UTF-8';
# Force caching for CSS and JS raw content, default: 5 minutes
if( is_null( $smaxage ) && ( $ctype == 'text/css' || $ctype == $wgJsMimeType ) ) {
# Upconvert on demand.
# ("utf8" checked for compatibility with some broken
# conversion scripts 2008-12-30)
- global $wgInputEncoding, $wgContLang;
- $text = $wgContLang->iconv( $wgLegacyEncoding, $wgInputEncoding, $text );
+ global $wgContLang;
+ $text = $wgContLang->iconv( $wgLegacyEncoding, 'UTF-8', $text );
}
}
wfProfileOut( __METHOD__ );
function outputPage( OutputPage $out ) {
global $wgUser, $wgLang, $wgContLang;
global $wgScript, $wgStylePath, $wgLanguageCode;
- global $wgMimeType, $wgJsMimeType, $wgOutputEncoding, $wgRequest;
+ global $wgMimeType, $wgJsMimeType, $wgRequest;
global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces, $wgHtml5Version;
global $wgDisableCounters, $wgLogo, $wgHideInterlanguageLinks;
global $wgMaxCredits, $wgShowCreditsIfMax;
$tpl->setRef( 'mimetype', $wgMimeType );
$tpl->setRef( 'jsmimetype', $wgJsMimeType );
- $tpl->setRef( 'charset', $wgOutputEncoding );
+ $tpl->setRef( 'charset', 'UTF-8' );
$tpl->setRef( 'wgScript', $wgScript );
$tpl->setRef( 'skinname', $this->skinname );
$tpl->set( 'skinclass', get_class( $this ) );
* @return Status object
*/
public static function send( $to, $from, $subject, $body, $replyto = null, $contentType = null ) {
- global $wgSMTP, $wgOutputEncoding, $wgEnotifImpersonal;
+ global $wgSMTP, $wgEnotifImpersonal;
global $wgEnotifMaxRecips, $wgAdditionalMailParams;
if ( is_array( $to ) ) {
$headers['Date'] = date( 'r' );
$headers['MIME-Version'] = '1.0';
$headers['Content-type'] = ( is_null( $contentType ) ?
- 'text/plain; charset=' . $wgOutputEncoding : $contentType );
+ 'text/plain; charset=UTF-8' : $contentType );
$headers['Content-transfer-encoding'] = '8bit';
$headers['Message-ID'] = "<$msgid@" . $wgSMTP['IDHost'] . '>'; // FIXME
$headers['X-Mailer'] = 'MediaWiki mailer';
$endl = "\n";
}
$ctype = ( is_null( $contentType ) ?
- 'text/plain; charset=' . $wgOutputEncoding : $contentType );
+ 'text/plain; charset=UTF-8' : $contentType );
$headers =
"MIME-Version: 1.0$endl" .
"Content-type: $ctype$endl" .
public static function quotedPrintable( $string, $charset = '' ) {
# Probably incomplete; see RFC 2045
if( empty( $charset ) ) {
- global $wgInputEncoding;
- $charset = $wgInputEncoding;
+ $charset = 'UTF-8';
}
$charset = strtoupper( $charset );
$charset = str_replace( 'ISO-8859', 'ISO8859', $charset ); // ?
/* Working directory to/from output */
public function loadFromFileCache() {
- global $wgOut, $wgMimeType, $wgOutputEncoding, $wgLanguageCode;
+ global $wgOut, $wgMimeType, $wgLanguageCode;
wfDebug( __METHOD__ . "()\n");
$filename = $this->fileCacheName();
// Raw pages should handle cache control on their own,
// even when using file cache. This reduces hits from clients.
if( $this->mType !== 'raw' ) {
$wgOut->sendCacheControl();
- header( "Content-Type: $wgMimeType; charset={$wgOutputEncoding}" );
+ header( "Content-Type: $wgMimeType; charset=UTF-8" );
header( "Content-Language: $wgLanguageCode" );
}
# we'll use the application/x-external-editor interface to call
# an external diff tool like kompare, kdiff3, etc.
if ( $wgUseExternalEditor && $wgUser->getOption( 'externaldiff' ) ) {
- global $wgInputEncoding, $wgServer, $wgScript, $wgLang;
+ global $wgServer, $wgScript, $wgLang;
$wgOut->disable();
- header ( "Content-type: application/x-external-editor; charset=" . $wgInputEncoding );
+ header ( "Content-type: application/x-external-editor; charset=UTF-8" );
$url1 = $this->mTitle->getFullURL( array(
'action' => 'raw',
'oldid' => $this->mOldid
wfProfileOut( __METHOD__ );
return;
}
- global $wgInputEncoding;
$wgOut->addHTML(
Xml::openElement( 'fieldset' ) .
Xml::element( 'legend', null, wfMsg( 'search-external' ) ) .
Xml::element( 'p', array( 'class' => 'mw-searchdisabled' ), wfMsg( 'searchdisabled' ) ) .
wfMsg( 'googlesearch',
htmlspecialchars( $term ),
- htmlspecialchars( $wgInputEncoding ),
+ htmlspecialchars( 'UTF-8' ),
htmlspecialchars( wfMsg( 'searchbutton' ) )
) .
Xml::closeElement( 'fieldset' )
global $wgLanguageNames;
require_once( dirname( __FILE__ ) . '/Names.php' );
-global $wgInputEncoding, $wgOutputEncoding;
-
-/**
- * These are always UTF-8, they exist only for backwards compatibility
- */
-$wgInputEncoding = 'UTF-8';
-$wgOutputEncoding = 'UTF-8';
-
if ( function_exists( 'mb_strtoupper' ) ) {
mb_internal_encoding( 'UTF-8' );
}