Make WordPress Core

Changeset 61855


Ignore:
Timestamp:
03/06/2026 06:01:47 PM (33 hours ago)
Author:
dmsnell
Message:

Formatting: Transform “ẞ” for German locales in remove_accents().

The capital Eszett was standardized in German orthography in 2017, DIN 5008, but WordPress has only been transforming the lowercase version.

This patch adds the uppercase variant to the list and transforms it to “SS” for more-appriate slug and permalink generation.

Developed in: https://github.com/WordPress/wordpress-develop/pull/11188
Discussed in: https://core.trac.wordpress.org/ticket/64821

Props apermo, dmsnell.
Fixes #64821.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r61590 r61855  
    15671567 * | U+00DC   | Ü     | Ue          | Latin capital letter U with diaeresis   |
    15681568 * | U+00FC   | ü     | ue          | Latin small letter u with diaeresis     |
     1569 * | U+1E9E   | ẞ     | SS          | Latin capital letter sharp s            |
    15691570 * | U+00DF   | ß     | ss          | Latin small letter sharp s              |
    15701571 *
     
    16001601 * @since 6.0.0 Added the `$locale` parameter.
    16011602 * @since 6.1.0 Added Unicode NFC encoding normalization support.
     1603 * @since 7.0.0 Added capital Eszett (U+1E9E) support for German locales.
    16021604 *
    16031605 * @param string $text   Text that might have accent characters.
     
    19731975            $chars['Ü'] = 'Ue';
    19741976            $chars['ü'] = 'ue';
     1977            $chars['ẞ'] = 'SS';
    19751978            $chars['ß'] = 'ss';
    19761979        } elseif ( 'da_DK' === $locale ) {
  • trunk/tests/phpunit/tests/formatting/removeAccents.php

    r53754 r61855  
    110110
    111111    /**
     112     * @ticket 64821
     113     */
     114    public function test_remove_accents_germanic_capital_eszett() {
     115        // U+1E9E LATIN CAPITAL LETTER SHARP S, standardized in German orthography in 2017 (DIN 5008).
     116        $this->assertSame( 'SS', remove_accents( 'ẞ', 'de_DE' ) );
     117        // Verify it works in context alongside the lowercase variant.
     118        $this->assertSame( 'SSstrasse', remove_accents( 'ẞstraße', 'de_DE' ) );
     119    }
     120
     121    /**
    112122     * @ticket 23907
    113123     */
Note: See TracChangeset for help on using the changeset viewer.