TrimResolver doesn't respect UTF-8

Open Beginner friendly
#130 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
php
Domain
backend

Research direction

Start at the TrimResolver entry point and inspect how its trim operation handles UTF-8 whitespace and custom characters. Verify the behavior with the listed no-break and em-space examples, along with ASCII trimming, and consider the issue resolved when UTF-8 spaces are removed without breaking multibyte characters.

Written by the indexing model from the issue text.

Description

Description

#[Trim] / TrimResolver does not trim UTF-8 specific spaces,
like "\u00A0" NO-BREAK SPACE, "\u2002" EN SPACE, "\u2003" EM SPACE, etc.

And such spaces can't be removed using custom chars for trim() as it will break some UTF-8 characters, instead mb_trim() should be used, it will handle UTF-8 and ASCII as well.

Package version

No response

PHP version

No response

Dominant language
PHP
Stars
34
Forks
6
Avg merge
17m
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from yiisoft/hydrator

All issues in yiisoft/hydrator

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.