From cecb985bee3bdd252e1b8dc0bd500b37cd52be01 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 16 May 2007 20:58:53 +0000 Subject: Aktualisierung auf MediaWiki 1.10.0 Plugins angepasst und verbessert kleine Korrekturen am Design --- includes/normal/UtfNormal.php | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'includes/normal/UtfNormal.php') diff --git a/includes/normal/UtfNormal.php b/includes/normal/UtfNormal.php index d8eac7b8..43bbafd8 100644 --- a/includes/normal/UtfNormal.php +++ b/includes/normal/UtfNormal.php @@ -17,21 +17,6 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # http://www.gnu.org/copyleft/gpl.html -/** - * Unicode normalization routines for working with UTF-8 strings. - * Currently assumes that input strings are valid UTF-8! - * - * Not as fast as I'd like, but should be usable for most purposes. - * UtfNormal::toNFC() will bail early if given ASCII text or text - * it can quickly deterimine is already normalized. - * - * All functions can be called static. - * - * See description of forms at http://www.unicode.org/reports/tr15/ - * - * @package UtfNormal - */ - /** */ require_once dirname(__FILE__).'/UtfNormalUtil.php'; @@ -111,8 +96,18 @@ define( 'UNORM_FCD', 6 ); define( 'NORMALIZE_ICU', function_exists( 'utf8_normalize' ) ); /** + * Unicode normalization routines for working with UTF-8 strings. + * Currently assumes that input strings are valid UTF-8! * - * @package MediaWiki + * Not as fast as I'd like, but should be usable for most purposes. + * UtfNormal::toNFC() will bail early if given ASCII text or text + * it can quickly deterimine is already normalized. + * + * All functions can be called static. + * + * See description of forms at http://www.unicode.org/reports/tr15/ + * + * @addtogroup UtfNormal */ class UtfNormal { /** @@ -124,7 +119,7 @@ class UtfNormal { * * @param string $string a UTF-8 string * @return string a clean, shiny, normalized UTF-8 string - * @static + * @static */ static function cleanUp( $string ) { if( NORMALIZE_ICU ) { @@ -226,7 +221,7 @@ class UtfNormal { static function loadData() { global $utfCombiningClass; if( !isset( $utfCombiningClass ) ) { - require_once( 'UtfNormalData.inc' ); + require_once( dirname(__FILE__) . '/UtfNormalData.inc' ); } } @@ -635,7 +630,11 @@ class UtfNormal { } if( isset( $utfCombiningClass[$c] ) ) { $lastClass = $utfCombiningClass[$c]; - @$combiners[$lastClass] .= $c; + if( isset( $combiners[$lastClass] ) ) { + $combiners[$lastClass] .= $c; + } else { + $combiners[$lastClass] = $c; + } continue; } } @@ -805,4 +804,4 @@ class UtfNormal { } } -?> \ No newline at end of file +?> -- cgit v1.2.2