From cbd75a54734111cefb2f2ef199257ca96909e341 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Mon, 14 Aug 2017 18:44:40 -0700 Subject: [PATCH] Hard deprecate UtfNormalUtil Deprecated in 1.25, last vestiges have been removed. Inline one last function that's not supposed to be public anyway. Change-Id: If44c6a9cce7d2d95dc63e6f135b73b8c969f1c07 --- includes/compat/normal/UtfNormalUtil.php | 5 +++++ maintenance/language/digit2html.php | 2 +- maintenance/language/generateCollationData.php | 5 ----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/compat/normal/UtfNormalUtil.php b/includes/compat/normal/UtfNormalUtil.php index d60c8e33ce..0e29dd07b0 100644 --- a/includes/compat/normal/UtfNormalUtil.php +++ b/includes/compat/normal/UtfNormalUtil.php @@ -37,6 +37,7 @@ use UtfNormal\Utils; * @deprecated since 1.25, use UtfNormal\Utils directly */ function codepointToUtf8( $codepoint ) { + wfDeprecated( __FUNCTION__, '1.25' ); return Utils::codepointToUtf8( $codepoint ); } @@ -52,6 +53,7 @@ function codepointToUtf8( $codepoint ) { * @deprecated since 1.25, use UtfNormal\Utils directly */ function hexSequenceToUtf8( $sequence ) { + wfDeprecated( __FUNCTION__, '1.25' ); return Utils::hexSequenceToUtf8( $sequence ); } @@ -65,6 +67,7 @@ function hexSequenceToUtf8( $sequence ) { * @private */ function utf8ToHexSequence( $str ) { + wfDeprecated( __FUNCTION__, '1.25' ); $buf = ''; foreach ( preg_split( '//u', $str, -1, PREG_SPLIT_NO_EMPTY ) as $cp ) { $buf .= sprintf( '%04x ', UtfNormal\Utils::utf8ToCodepoint( $cp ) ); @@ -83,6 +86,7 @@ function utf8ToHexSequence( $str ) { * @deprecated since 1.25, use UtfNormal\Utils directly */ function utf8ToCodepoint( $char ) { + wfDeprecated( __FUNCTION__, '1.25' ); return Utils::utf8ToCodepoint( $char ); } @@ -95,5 +99,6 @@ function utf8ToCodepoint( $char ) { * @deprecated since 1.25, use UtfNormal\Utils directly */ function escapeSingleString( $string ) { + wfDeprecated( __FUNCTION__, '1.25' ); return Utils::escapeSingleString( $string ); } diff --git a/maintenance/language/digit2html.php b/maintenance/language/digit2html.php index 9aacf516ee..f1e74ad9f3 100644 --- a/maintenance/language/digit2html.php +++ b/maintenance/language/digit2html.php @@ -57,7 +57,7 @@ class Digit2Html extends Maintenance { $this->output( "OK\n\$digitTransformTable = [\n" ); foreach ( $digitTransformTable as $latin => $translation ) { - $htmlent = utf8ToHexSequence( $translation ); + $htmlent = bin2hex( $translation ); $this->output( "'$latin' => '$translation', # &#x$htmlent;\n" ); } $this->output( "];\n" ); diff --git a/maintenance/language/generateCollationData.php b/maintenance/language/generateCollationData.php index 85949d84d4..fafc1c6c28 100644 --- a/maintenance/language/generateCollationData.php +++ b/maintenance/language/generateCollationData.php @@ -323,11 +323,6 @@ class GenerateCollationData extends Maintenance { $headerChars[] = $char; if ( $primaryCollator->compare( $char, $prevChar ) <= 0 ) { $numOutOfOrder++; - /* - printf( "Out of order: U+%05X > U+%05X\n", - utf8ToCodepoint( $prevChar ), - utf8ToCodepoint( $char ) ); - */ } $prevChar = $char; -- 2.20.1