Index: docs/export-0.4.xsd
===================================================================
--- docs/export-0.4.xsd	(revision 0)
+++ docs/export-0.4.xsd	(revision 0)
@@ -0,0 +1,320 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+	This is an XML Schema description of the format
+	output by MediaWiki's Special:Export system.
+	
+	Version 0.2 adds optional basic file upload info support,
+	which is used by our OAI export/import submodule.
+	
+	Version 0.3 adds some site configuration information such
+	as a list of defined namespaces.
+	
+	Version 0.4 adds support for per-namespace capitalization
+	
+	The canonical URL to the schema document is:
+	http://www.mediawiki.org/xml/export-0.4.xsd
+	
+	Use the namespace:
+	http://www.mediawiki.org/xml/export/
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:mw="http://www.mediawiki.org/xml/export-0.4/"
+        targetNamespace="http://www.mediawiki.org/xml/"
+        version="0.4"
+        elementFormDefault="qualified">
+
+	<annotation>
+		<documentation xml:lang="en">
+			MediaWiki's page export format
+		</documentation>
+	</annotation>
+	
+	<!-- Need this to reference xml:lang -->
+	<import namespace="http://www.w3.org/XML/1998/namespace"
+		schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+	
+	<!-- Our root element -->
+	<element name="mediawiki" type="mw:MediaWikiType"/>
+	
+	<complexType name="MediaWikiType">
+		<sequence>
+			<element name="siteinfo" type="mw:SiteInfoType"
+				minOccurs="0" maxOccurs="1"/>
+			<element name="page" type="mw:PageType"
+				minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+		<attribute name="version" type="string" use="required"/>
+		<attribute ref="xml:lang" use="required"/>
+	</complexType>
+	
+	<complexType name="SiteInfoType">
+		<sequence>
+			<element name="sitename" type="string" minOccurs="0" />
+			<element name="base" type="anyURI" minOccurs="0" />
+			<element name="generator" type="string" minOccurs="0" />
+			<element name="case" type="mw:CaseType" minOccurs="0" />
+			<element name="namespaces" type="mw:NamespacesType" minOccurs="0" />
+		</sequence>
+	</complexType>
+	
+	<simpleType name="CaseType">
+		<restriction base="NMTOKEN">
+			<!-- Cannot have two titles differing only by case of first letter. -->
+			<!-- Default behavior through 1.5, $wgCapitalLinks = true -->
+			<enumeration value="first-letter" />
+			
+			<!-- Complete title is case-sensitive -->
+			<!-- Behavior when $wgCapitalLinks = false -->
+			<enumeration value="case-sensitive" />
+			
+			<!-- Cannot have two titles differing only by case. -->
+			<!-- Not yet implemented as of MediaWiki 1.5 -->
+			<enumeration value="case-insensitive" />
+		</restriction>
+	</simpleType>
+	
+	<complexType name="NamespacesType">
+		<sequence>
+			<element name="namespace" type="mw:NamespaceType"
+				minOccurs="0" maxOccurs="unbounded" />
+		</sequence>
+	</complexType>
+	
+	<complexType name="NamespaceType">
+		<simpleContent>
+			<extension base="string">
+				<attribute name="key" type="integer" />
+				<attribute name="case" type="mw:CaseType" />
+			</extension>
+		</simpleContent>
+	</complexType>
+	
+	<complexType name="PageType">
+		<sequence>
+			<!-- Title in text form. (Using spaces, not underscores; with namespace ) -->
+			<element name="title" type="string"/>
+			
+			<!-- optional page ID number -->
+			<element name="id" type="positiveInteger" minOccurs="0"/>
+			
+			<!-- comma-separated list of string tokens, if present -->
+			<element name="restrictions" type="string" minOccurs="0"/>
+			
+			<!-- Zero or more sets of revision or upload data -->
+			<choice minOccurs="0" maxOccurs="unbounded">
+				<element name="revision" type="mw:RevisionType" />
+				<element name="upload" type="mw:UploadType" />
+			</choice>
+		</sequence>
+	</complexType>
+	
+	<complexType name="RevisionType">
+		<sequence>
+			<element name="id" type="positiveInteger" minOccurs="0"/>
+			<element name="timestamp" type="dateTime"/>
+			<element name="contributor" type="mw:ContributorType"/>
+			<element name="minor" minOccurs="0" />
+			<element name="comment" type="string" minOccurs="0"/>
+			<element name="text" type="mw:TextType" />
+		</sequence>
+	</complexType>
+	
+	<complexType name="TextType">
+		<simpleContent>
+			<extension base="string">
+				<attribute ref="xml:space" use="optional" default="preserve" />
+			</extension>
+		</simpleContent>
+	</complexType>
+	
+	<complexType name="ContributorType">
+		<sequence>
+			<element name="username" type="string" minOccurs="0"/>
+			<element name="id" type="positiveInteger" minOccurs="0" />
+			
+			<element name="ip" type="string" minOccurs="0"/>
+		</sequence>
+	</complexType>
+	
+	<complexType name="UploadType">
+		<sequence>
+			<!-- Revision-style data... -->
+			<element name="timestamp" type="dateTime"/>
+			<element name="contributor" type="mw:ContributorType"/>
+			<element name="comment" type="string" minOccurs="0"/>
+			
+			<!-- Filename. (Using underscores, not spaces. No 'Image:' namespace marker.) -->
+			<element name="filename" type="string"/>
+			
+			<!-- URI at which this resource can be obtained -->
+			<element name="src" type="anyURI"/>
+			
+			<element name="size" type="positiveInteger" />
+			
+			<!-- TODO: add other metadata fields -->
+		</sequence>
+	</complexType>
+	
+</schema>
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+	This is an XML Schema description of the format
+	output by MediaWiki's Special:Export system.
+	
+	Version 0.2 adds optional basic file upload info support,
+	which is used by our OAI export/import submodule.
+	
+	Version 0.3 adds some site configuration information such
+	as a list of defined namespaces.
+	
+	Version 0.4 provides for capitalization differences per-
+	namespace
+	
+	The canonical URL to the schema document is:
+	http://www.mediawiki.org/xml/export-0.3.xsd
+	
+	Use the namespace:
+	http://www.mediawiki.org/xml/export-0.3/
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:mw="http://www.mediawiki.org/xml/export-0.3/"
+        targetNamespace="http://www.mediawiki.org/xml/export-0.3/"
+        elementFormDefault="qualified">
+
+	<annotation>
+		<documentation xml:lang="en">
+			MediaWiki's page export format
+		</documentation>
+	</annotation>
+	
+	<!-- Need this to reference xml:lang -->
+	<import namespace="http://www.w3.org/XML/1998/namespace"
+		schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+	
+	<!-- Our root element -->
+	<element name="mediawiki" type="mw:MediaWikiType"/>
+	
+	<complexType name="MediaWikiType">
+		<sequence>
+			<element name="siteinfo" type="mw:SiteInfoType"
+				minOccurs="0" maxOccurs="1"/>
+			<element name="page" type="mw:PageType"
+				minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+		<attribute name="version" type="string" use="required"/>
+		<attribute ref="xml:lang" use="required"/>
+	</complexType>
+	
+	<complexType name="SiteInfoType">
+		<sequence>
+			<element name="sitename" type="string" minOccurs="0" />
+			<element name="base" type="anyURI" minOccurs="0" />
+			<element name="generator" type="string" minOccurs="0" />
+			<element name="case" type="mw:CaseType" minOccurs="0" />
+			<element name="namespaces" type="mw:NamespacesType" minOccurs="0" />
+		</sequence>
+	</complexType>
+	
+	<simpleType name="CaseType">
+		<restriction base="NMTOKEN">
+			<!-- Cannot have two titles differing only by case of first letter. -->
+			<!-- Default behavior through 1.5, $wgCapitalLinks = true -->
+			<enumeration value="first-letter" />
+			
+			<!-- Complete title is case-sensitive -->
+			<!-- Behavior when $wgCapitalLinks = false -->
+			<enumeration value="case-sensitive" />
+			
+			<!-- Cannot have two titles differing only by case. -->
+			<!-- Not yet implemented as of MediaWiki 1.5 -->
+			<enumeration value="case-insensitive" />
+			
+			<!-- Some wikis may capitalize per-namespace -->
+			<!-- This is only since 1.15 -->
+			<enumeration value="per-namespace" />
+		</restriction>
+	</simpleType>
+	
+	<complexType name="NamespacesType">
+		<sequence>
+			<element name="namespace" type="mw:NamespaceType"
+				minOccurs="0" maxOccurs="unbounded" />
+		</sequence>
+	</complexType>
+	
+	<complexType name="NamespaceType">
+		<simpleContent>
+			<extension base="string">
+				<attribute name="key" type="integer" />
+				<attribute name="case" type="mw:CaseType" minOccurs="0" />
+			</extension>
+		</simpleContent>
+	</complexType>
+	
+	<complexType name="PageType">
+		<sequence>
+			<!-- Title in text form. (Using spaces, not underscores; with namespace ) -->
+			<element name="title" type="string"/>
+			
+			<!-- optional page ID number -->
+			<element name="id" type="positiveInteger" minOccurs="0"/>
+			
+			<!-- comma-separated list of string tokens, if present -->
+			<element name="restrictions" type="string" minOccurs="0"/>
+			
+			<!-- Zero or more sets of revision or upload data -->
+			<choice minOccurs="0" maxOccurs="unbounded">
+				<element name="revision" type="mw:RevisionType" />
+				<element name="upload" type="mw:UploadType" />
+			</choice>
+		</sequence>
+	</complexType>
+	
+	<complexType name="RevisionType">
+		<sequence>
+			<element name="id" type="positiveInteger" minOccurs="0"/>
+			<element name="timestamp" type="dateTime"/>
+			<element name="contributor" type="mw:ContributorType"/>
+			<element name="minor" minOccurs="0" />
+			<element name="comment" type="string" minOccurs="0"/>
+			<element name="text" type="mw:TextType" />
+		</sequence>
+	</complexType>
+	
+	<complexType name="TextType">
+		<simpleContent>
+			<extension base="string">
+				<attribute ref="xml:space" use="optional" default="preserve" />
+			</extension>
+		</simpleContent>
+	</complexType>
+	
+	<complexType name="ContributorType">
+		<sequence>
+			<element name="username" type="string" minOccurs="0"/>
+			<element name="id" type="positiveInteger" minOccurs="0" />
+			
+			<element name="ip" type="string" minOccurs="0"/>
+		</sequence>
+	</complexType>
+	
+	<complexType name="UploadType">
+		<sequence>
+			<!-- Revision-style data... -->
+			<element name="timestamp" type="dateTime"/>
+			<element name="contributor" type="mw:ContributorType"/>
+			<element name="comment" type="string" minOccurs="0"/>
+			
+			<!-- Filename. (Using underscores, not spaces. No 'Image:' namespace marker.) -->
+			<element name="filename" type="string"/>
+			
+			<!-- URI at which this resource can be obtained -->
+			<element name="src" type="anyURI"/>
+			
+			<element name="size" type="positiveInteger" />
+			
+			<!-- TODO: add other metadata fields -->
+		</sequence>
+	</complexType>
+	
+</schema>
Index: includes/api/ApiQuerySiteinfo.php
===================================================================
--- includes/api/ApiQuerySiteinfo.php	(revision 47769)
+++ includes/api/ApiQuerySiteinfo.php	(working copy)
@@ -148,7 +148,8 @@
 		foreach( $wgContLang->getFormattedNamespaces() as $ns => $title )
 		{
 			$data[$ns] = array(
-				'id' => $ns
+				'id' => $ns,
+				'case' => MWNamespace::isCapitalized( $ns ) ? 'first-letter' : 'case-sensitive',
 			);
 			ApiResult :: setContent( $data[$ns], $title );
 			$canonical = MWNamespace::getCanonicalName( $ns );
Index: includes/DefaultSettings.php
===================================================================
--- includes/DefaultSettings.php	(revision 47769)
+++ includes/DefaultSettings.php	(working copy)
@@ -200,10 +200,10 @@
  *    thumbScriptUrl    The URL for thumb.php (optional, not recommended)
  *    transformVia404   Whether to skip media file transformation on parse and rely on a 404
  *                      handler instead.
- *    initialCapital    Equivalent to $wgCapitalLinks, determines whether filenames implicitly
- *                      start with a capital letter. The current implementation may give incorrect
- *                      description page links when the local $wgCapitalLinks and initialCapital
- *                      are mismatched.
+ *    initialCapital    Equivalent to $wgCapitalLinks (or $wgCapitalLinkOverrides[NS_FILE], 
+ *                      determines whether filenames implicitly start with a capital letter. 
+ *                      The current implementation may give incorrect description page links 
+ *                      when the local $wgCapitalLinks and initialCapital are mismatched.
  *    pathDisclosureProtection
  *                      May be 'paranoid' to remove all parameters from error messages, 'none' to
  *                      leave the paths in unchanged, or 'simple' to replace paths with
@@ -2239,6 +2239,19 @@
  * same place as links in the middle of a sentence using a lowercase initial.
  */
 $wgCapitalLinks = true;
+ 
+ 
+/**
+ * @since 1.15 - This can now be set per-namespace. Some special namespaces (such
+ * as Special, see Namespace::$alwaysCapitalizedNamespaces for the full list) must be 
+ * true by default (and setting them has no effect), due to various things that 
+ * require them to be so. Also, since Talk namespaces need to directly mirror their 
+ * associated content namespaces, the values for those are ignored in favor of the 
+ * subject namespace's setting. Setting for NS_MEDIA is taken automatically from 
+ * NS_FILE.
+ * EX: $wgCapitalLinkOverrides[ NS_FILE ] = false;
+ */
+$wgCapitalLinkOverrides = array();
 
 /**
  * List of interwiki prefixes for wikis we'll accept as sources for
@@ -3163,7 +3176,7 @@
  *     'Main_Page' => 'noindex,follow',
  *     # "Project", not the actual project name!
  *     'Project:X' => 'index,follow',
- *     # Needs to be "Abc", not "abc" (unless $wgCapitalLinks is false)!
+ *     # Needs to be "Abc", not "abc" (unless $wgCapitalLinks is false for that namespace)!
  *     'abc' => 'noindex,nofollow'
  *   );
  */
Index: includes/Export.php
===================================================================
--- includes/Export.php	(revision 47769)
+++ includes/Export.php	(working copy)
@@ -336,7 +336,7 @@
 	 * @return string
 	 */
 	function schemaVersion() {
-		return "0.3"; // FIXME: upgrade to 0.4 when updated XSD is ready, for the revision deletion bits
+		return "0.4"; // FIXME: upgrade to 0.5 when updated XSD is ready, for the revision deletion bits
 	}
 
 	/**
@@ -401,7 +401,11 @@
 		global $wgContLang;
 		$spaces = "<namespaces>\n";
 		foreach( $wgContLang->getFormattedNamespaces() as $ns => $title ) {
-			$spaces .= '      ' . Xml::element( 'namespace', array( 'key' => $ns ), $title ) . "\n";
+			$spaces .= '      ' . 
+				Xml::element( 'namespace', 
+					array(	'key' => $ns,
+							'case' => MWNamespace::isCapitalized( $ns ) ? 'first-letter' : 'case-sensitive',
+					), $title ) . "\n";
 		}
 		$spaces .= "    </namespaces>";
 		return $spaces;
Index: includes/filerepo/FileRepo.php
===================================================================
--- includes/filerepo/FileRepo.php	(revision 47769)
+++ includes/filerepo/FileRepo.php	(working copy)
@@ -29,7 +29,7 @@
 		$this->name = $info['name'];
 
 		// Optional settings
-		$this->initialCapital = true; // by default
+		$this->initialCapital = MWNamespace::isCapitalized( NS_FILE ); // by default
 		foreach ( array( 'descBaseUrl', 'scriptDirUrl', 'articleUrl', 'fetchDescription',
 			'thumbScriptUrl', 'initialCapital', 'pathDisclosureProtection', 
 			'descriptionCacheExpiry', 'apiThumbCacheExpiry', 'hashLevels' ) as $var )
@@ -213,13 +213,9 @@
 	 * Get the name of an image from its title object
 	 */
 	function getNameFromTitle( $title ) {
-		global $wgCapitalLinks;
-		if ( $this->initialCapital != $wgCapitalLinks ) {
+		if ( $this->initialCapital != MWNamespace::isCapitalized( NS_FILE ) ) {
 			global $wgContLang;
-			$name = $title->getUserCaseDBKey();
-			if ( $this->initialCapital ) {
-				$name = $wgContLang->ucfirst( $name );
-			}
+			$name = Title::capitalize( $title->getUserCaseDBKey(), NS_FILE );
 		} else {
 			$name = $title->getDBkey();
 		}
Index: includes/Import.php
===================================================================
--- includes/Import.php	(revision 47769)
+++ includes/Import.php	(working copy)
@@ -399,7 +399,7 @@
 		wfDebug( "WikiImporter XML error: $err\n" );
 	}
 
-	function handleXmlNamespace ( $parser, $data, $prefix=false, $uri=false ) {
+	function handleXml ( $parser, $data, $prefix=false, $uri=false ) {
     		 if( preg_match( '/www.mediawiki.org/',$prefix ) ) {
 	                $prefix = str_replace( '/','\/',$prefix );
 			$this->mXmlNamespace='/^'.$prefix.':/';
@@ -411,8 +411,8 @@
 	               return(preg_replace($this->mXmlNamespace,'',$name,1));
 		}
 		else {
-		       return($name);
-                }
+			return($name);
+		}
 	}
    
 	# --------------
Index: includes/Namespace.php
===================================================================
--- includes/Namespace.php	(revision 47769)
+++ includes/Namespace.php	(working copy)
@@ -46,6 +46,13 @@
 class MWNamespace {
 
 	/**
+	 * These namespaces should always be first-letter capitalized, now and 
+	 * forevermore. Historically, they could've probably been lowercased too, 
+	 * but some things are just too ingrained now. :)
+	 */
+	private static $alwaysCapitalizedNamespaces = array( NS_SPECIAL, NS_MEDIAWIKI );
+
+	/**
 	 * Can pages in the given namespace be moved?
 	 *
 	 * @param $index Int: namespace index
@@ -181,5 +188,31 @@
 		global $wgNamespacesWithSubpages;
 		return !empty( $wgNamespacesWithSubpages[$index] );
 	}
+	
+	/**
+	 * Is the namespace first-letter capitalized?
+	 * 
+	 * @param $index int Index to check
+	 * @return bool
+	 */
+	public static function isCapitalized( $index ) {
+		global $wgCapitalLinks, $wgCapitalLinkOverrides;
+		// Turn NS_MEDIA into NS_FILE
+		$index = $index === NS_MEDIA ? NS_FILE : $index;
+		
+		// Make sure to get the subject of our namespace
+		$index = self::getSubject( $index );
+		
+		// Some namespaces are special and should always be upper case
+		if ( in_array( $index, self::$alwaysCapitalizedNamespaces ) ) {
+			return true;
+		}
+		if ( isset( $wgCapitalLinkOverrides[ $index ] ) ) {
+			// $wgCapitalLinkOverrides is explicitly set
+			return $wgCapitalLinkOverrides[ $index ];
+		}
+		// Default to the global setting
+		return $wgCapitalLinks;
+	}
 
 }
Index: includes/Setup.php
===================================================================
--- includes/Setup.php	(revision 47769)
+++ includes/Setup.php	(working copy)
@@ -87,7 +87,6 @@
 		'hashLevels' => $wgHashedUploadDirectory ? 2 : 0,
 		'thumbScriptUrl' => $wgThumbnailScriptPath,
 		'transformVia404' => !$wgGenerateThumbnailOnParse,
-		'initialCapital' => $wgCapitalLinks,
 		'deletedDir' => $wgFileStore['deleted']['directory'],
 		'deletedHashLevels' => $wgFileStore['deleted']['hash']
 	);
Index: includes/specials/SpecialCategories.php
===================================================================
--- includes/specials/SpecialCategories.php	(revision 47769)
+++ includes/specials/SpecialCategories.php	(working copy)
@@ -35,10 +35,8 @@
 		parent::__construct();
 		$from = str_replace( ' ', '_', $from );
 		if( $from !== '' ) {
-			global $wgCapitalLinks, $wgContLang;
-			if( $wgCapitalLinks ) {
-				$from = $wgContLang->ucfirst( $from );
-			}
+			global $wgContLang;
+			$from = Title::capitalize( $from, NS_CATEGORY );
 			$this->mOffset = $from;
 		}
 	}
Index: includes/specials/SpecialUpload.php
===================================================================
--- includes/specials/SpecialUpload.php	(revision 47769)
+++ includes/specials/SpecialUpload.php	(working copy)
@@ -511,10 +511,7 @@
 			$warning = '';
 
 			$comparableName = str_replace( ' ', '_', $basename );
-			global $wgCapitalLinks, $wgContLang;
-			if ( $wgCapitalLinks ) {
-				$comparableName = $wgContLang->ucfirst( $comparableName );
-			}
+			$comparableName = Title::capitalize( $comparableName, NS_FILE );
 
 			if( $comparableName !== $filtered ) {
 				$warning .=  '<li>'.wfMsgHtml( 'badfilename', htmlspecialchars( $this->mDestName ) ).'</li>';
Index: includes/specials/SpecialWithoutinterwiki.php
===================================================================
--- includes/specials/SpecialWithoutinterwiki.php	(revision 47769)
+++ includes/specials/SpecialWithoutinterwiki.php	(working copy)
@@ -75,13 +75,11 @@
 }
 
 function wfSpecialWithoutinterwiki() {
-	global $wgRequest, $wgContLang, $wgCapitalLinks;
+	global $wgRequest, $wgContLang;
 	list( $limit, $offset ) = wfCheckLimits();
-	if( $wgCapitalLinks ) {
-		$prefix = $wgContLang->ucfirst( $wgRequest->getVal( 'prefix' ) );
-	} else {
-		$prefix = $wgRequest->getVal( 'prefix' );
-	}
+	// Only searching the mainspace anyway
+	$prefix = Title::capitalize( $wgRequest->getVal( 'prefix' ), NS_MAIN );
+	
 	$wip = new WithoutInterwikiPage();
 	$wip->setPrefix( $prefix );
 	$wip->doQuery( $offset, $limit );
Index: includes/Title.php
===================================================================
--- includes/Title.php	(revision 47769)
+++ includes/Title.php	(working copy)
@@ -471,6 +471,18 @@
 		}
 		return $name;
 	}
+	
+	/**
+	 * Capitalize a text if it belongs to a namespace that capitalizes
+	 */
+	public static function capitalize( $text, $ns = NS_MAIN ) {
+		global $wgContLang;
+		
+		if ( MWNamespace::isCapitalized( $ns ) )
+			return $wgContLang->ucfirst( $text );
+		else
+			return $text;
+	}
 
 	/**
 	 * Returns the URL associated with an interwiki prefix
@@ -2164,7 +2176,7 @@
 	 * @return \type{\bool} true on success
 	 */
 	private function secureAndSplit() {
-		global $wgContLang, $wgLocalInterwiki, $wgCapitalLinks;
+		global $wgContLang, $wgLocalInterwiki;
 
 		# Initialisation
 		static $rxTc = false;
@@ -2340,8 +2352,8 @@
 		 * site might be case-sensitive.
 		 */
 		$this->mUserCaseDBKey = $dbkey;
-		if( $wgCapitalLinks && $this->mInterwiki == '') {
-			$dbkey = $wgContLang->ucfirst( $dbkey );
+		if ( $this->mInterwiki == '') {
+			$dbkey = Title::capitalize( $dbkey, $this->mNamespace );
 		}
 
 		/**
Index: includes/User.php
===================================================================
--- includes/User.php	(revision 47769)
+++ includes/User.php	(working copy)
@@ -502,7 +502,7 @@
 		|| User::isIP( $name )
 		|| strpos( $name, '/' ) !== false
 		|| strlen( $name ) > $wgMaxNameChars
-		|| $name != $wgContLang->ucfirst( $name ) ) {
+		|| ( $name != Title::capitalize( $name, NS_USER ) ) ) {
 			wfDebugLog( 'username', __METHOD__ .
 				": '$name' invalid due to empty, IP, slash, length, or lowercase" );
 			return false;
@@ -648,9 +648,8 @@
 	 */
 	static function getCanonicalName( $name, $validate = 'valid' ) {
 		# Force usernames to capital
-		global $wgContLang;
-		$name = $wgContLang->ucfirst( $name );
-
+		$name = Title::capitalize( $name, NS_USER );
+		
 		# Reject names containing '#'; these will be cleaned up
 		# with title normalisation, but then it's too late to
 		# check elsewhere
