public static function slug(string $str, string $delimiter = '-') : string
    {
        $str = static::toAscii($str);

        // Remove all characters that are neither alphanumeric, nor the separator nor a whitespace.
        $str = preg_replace('![^'.preg_quote($delimiter).'\pL\pN\s]+!u', '', mb_strtolower($str));

        // Standardize the separator.
        $flip = $delimiter == '-' ? '_' : '-';
        $str = preg_replace('!['.preg_quote($flip).']+!u', $delimiter, $str);

        // Replace all separator characters and whitespace by a single separator.
        $str = preg_replace('!['.preg_quote($delimiter).'\s]+!u', $delimiter, $str);

        return trim($str, $delimiter);
    }