Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/wp-includes/formatting.php
Original file line number Diff line number Diff line change
Expand Up @@ -1566,6 +1566,7 @@ function utf8_uri_encode( $utf8_string, $length = 0, $encode_ascii_characters =
* | U+00F6 | ö | oe | Latin small letter o with diaeresis |
* | U+00DC | Ü | Ue | Latin capital letter U with diaeresis |
* | U+00FC | ü | ue | Latin small letter u with diaeresis |
* | U+1E9E | ẞ | SS | Latin capital letter sharp s |
* | U+00DF | ß | ss | Latin small letter sharp s |
*
* Danish (`da_DK`) locale:
Expand Down Expand Up @@ -1599,6 +1600,7 @@ function utf8_uri_encode( $utf8_string, $length = 0, $encode_ascii_characters =
* @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.
* @since 7.0.0 Added capital Eszett (U+1E9E) support for German locales.
*
* @param string $text Text that might have accent characters.
* @param string $locale Optional. The locale to use for accent removal. Some character
Expand Down Expand Up @@ -1972,6 +1974,7 @@ function remove_accents( $text, $locale = '' ) {
$chars['ö'] = 'oe';
$chars['Ü'] = 'Ue';
$chars['ü'] = 'ue';
$chars['ẞ'] = 'SS';
Comment thread
apermo marked this conversation as resolved.
$chars['ß'] = 'ss';
} elseif ( 'da_DK' === $locale ) {
$chars['Æ'] = 'Ae';
Expand Down
10 changes: 10 additions & 0 deletions tests/phpunit/tests/formatting/removeAccents.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ public function test_remove_accents_germanic_umlauts() {
$this->assertSame( 'AeOeUeaeoeuess', remove_accents( 'ÄÖÜäöüß', 'de_DE' ) );
}

/**
* @ticket 64821
*/
public function test_remove_accents_germanic_capital_eszett() {
// U+1E9E LATIN CAPITAL LETTER SHARP S, standardized in German orthography in 2017 (DIN 5008).
$this->assertSame( 'SS', remove_accents( 'ẞ', 'de_DE' ) );
// Verify it works in context alongside the lowercase variant.
$this->assertSame( 'SSstrasse', remove_accents( 'ẞstraße', 'de_DE' ) );
}

/**
* @ticket 23907
*/
Expand Down
Loading