Skip to content

Use multibyte-aware trimming by default #137

Open

Description

@vjik

Multibyte mode was added to Trim, LeftTrim, RightTrim and ToArrayOfStrings attributes and their resolvers in #131. It's disabled by default to keep backward compatibility.

Most of the input in modern web applications is UTF-8, so multibyte-aware trimming is the expected behavior in most cases. The default value of the multibyte parameter in the resolvers should be changed
to true.

To do:

  • Change the default value of multibyte to true in TrimResolver, LeftTrimResolver, RightTrimResolver and ToArrayOfStringsResolver.
  • Throw LogicException when multibyte is true, but the required mb_* functions aren't available.
  • Update PHPDoc and docs/guide/en/typecasting.md.
  • Add an upgrade note.

⚠️ Don't implement it before start version 2.0 development

Activity

  1. added this to the 2.0 milestone on Oct 4, 2026
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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions