From f14cc4dd1da17940860bc7a4486deabfee757a0d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Thu, 8 Jul 2010 09:15:53 +0000 Subject: [PATCH] Added $wgAllUnicodeFixes to replace live-hack at twn --- includes/DefaultSettings.php | 12 ++++++++++++ languages/Language.php | 9 ++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index db0a9554b5..d193611e5d 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1776,6 +1776,18 @@ $wgFixArabicUnicode = true; */ $wgFixMalayalamUnicode = true; +/** + * Set this to always convert certain Unicode sequences to modern ones + * regardless of the content language. This has a small performance + * impact. + * + * See $wgFixArabicUnicode and $wgFixMalayalamUnicode for conversion + * details. + * + * @since 1.17 + */ +$wgAllUnicodeFixes = false; + /** * Set this to eg 'ISO-8859-1' to perform character set conversion when * loading old revisions not marked with "utf-8" flag. Use this when diff --git a/languages/Language.php b/languages/Language.php index cc2a95f9df..41619f7bd7 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1934,7 +1934,14 @@ class Language { * This is language-specific for performance reasons only. */ function normalize( $s ) { - return UtfNormal::cleanUp( $s ); + global $wgAllUnicodeFixes; + $s = UtfNormal::cleanUp( $s ); + if ( $wgAllUnicodeFixes ) { + $s = $this->transformUsingPairFile( 'normalize-ar.ser', $s ); + $s = $this->transformUsingPairFile( 'normalize-ml.ser', $s ); + } + + return $s; } /** -- 2.20.1