Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add support for multibyte strings #9372

Merged
merged 8 commits into from
Jan 7, 2025

Conversation

neznaika0
Copy link
Contributor

@neznaika0 neznaika0 commented Jan 5, 2025

Description

  • Unicode namespases App\Контроллеры\Админ allowed in Namespaces::truncate()
  • Now $view->excerpt('<unicode string>') and excerpt('<unicode string>') works correctly with characters, not bytes.

Can someone clarify why excerpt() adds an extra space and removes a character from the string? See tests - It sad So some nice, Это печ льно. И вот несколько. Missing dot and "a".

$result = ' Once upon a time, a framework had no tests. It sad So some nice people began to write tests. The more time that went on, the happier it became. ...';

$multibyteResult = ' Давным-давно во фреймворке не было тестов. Это печ льно. И вот несколько хороших людей начали писать тесты. Чем больше времени проходило, тем ...';

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@neznaika0 neznaika0 force-pushed the fix/func-to-multibyte branch from e919575 to dbe5eeb Compare January 6, 2025 09:36
@neznaika0 neznaika0 changed the base branch from develop to 4.6 January 6, 2025 09:37
@michalsn michalsn added the 4.6 label Jan 6, 2025
@paulbalandan paulbalandan added the enhancement PRs that improve existing functionalities label Jan 6, 2025
@neznaika0 neznaika0 force-pushed the fix/func-to-multibyte branch from dbe5eeb to 3bdc25c Compare January 7, 2025 18:18
@paulbalandan paulbalandan changed the title fix: Add support multibyte strings fix: Add support for multibyte strings Jan 7, 2025
@paulbalandan paulbalandan merged commit c79d3a9 into codeigniter4:4.6 Jan 7, 2025
50 checks passed
@paulbalandan
Copy link
Member

Thank you, @neznaika0

@neznaika0 neznaika0 deleted the fix/func-to-multibyte branch January 7, 2025 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.6 enhancement PRs that improve existing functionalities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants