Skip to content

url_title doesn't handle diacritics #2323

Description

@SteeveDroz

Describe the bug
When passing a string with diacritics to url_title, it doesn't handle diacritics in any way.

CodeIgniter 4 version
v4.0.0-rc.2.1

Affected module(s)
URL helper

Expected behavior, and steps to reproduce if appropriate

Currently

url_title('éléphant de PHP'); // returns "éléphant-de-PHP"
url_title('Éléphant de PHP', '-', true); // returns "Éléphant-de-php"

Expected behaviour

url_title('éléphant de PHP'); // returns "elephant-de-PHP"
url_title('Éléphant de PHP', '-', true); // returns "elephant-de-php"

// or, if retrocompatibility must be kept in some way, add a parameter

url_title('éléphant de PHP', '-', false, true); // returns "elephant-de-PHP"
url_title('Éléphant de PHP', '-', true, true); // returns "elephant-de-php"

Note

There is already a config file with the list of diacritics.

Context

  • OS: Linux Fedora 30
  • Web server Apache 2.4.41
  • PHP version 7.3.10

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions