diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 3b977f4f4e..46668daafe 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -1584,6 +1584,7 @@ function utf8_uri_encode( $utf8_string, $length = 0, $encode_ascii_characters = * @since 4.8.0 Added locale support for `bs_BA`. * @since 5.7.0 Added locale support for `de_AT`. * @since 6.0.0 Added the `$locale` parameter. + * @since 6.1.0 Added Unicode NFC encoding normalization support. * * @param string $string Text that might have accent characters. * @param string $locale Optional. The locale to use for accent removal. Some character @@ -1597,6 +1598,15 @@ function remove_accents( $string, $locale = '' ) { } if ( seems_utf8( $string ) ) { + + // Unicode sequence normalization from NFD (Normalization Form Decomposed) + // to NFC (Normalization Form [Pre]Composed), the encoding used in this function. + if ( function_exists( 'normalizer_normalize' ) ) { + if ( ! normalizer_is_normalized( $string, Normalizer::FORM_C ) ) { + $string = normalizer_normalize( $string, Normalizer::FORM_C ); + } + } + $chars = array( // Decompositions for Latin-1 Supplement. 'ยช' => 'a', diff --git a/wp-includes/version.php b/wp-includes/version.php index f2f32610df..aa8e485b85 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-alpha-53753'; +$wp_version = '6.1-alpha-53754'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.