Skip to content

[stable32] fix: multibyte text wrapping#6076

Merged
vitormattos merged 2 commits intostable32from
backport/6074/stable32
Dec 10, 2025
Merged

[stable32] fix: multibyte text wrapping#6076
vitormattos merged 2 commits intostable32from
backport/6074/stable32

Conversation

@backportbot-libresign
Copy link
Copy Markdown

Backport of PR #6074

The native PHP wordwrap() function does not handle multibyte characters
correctly, causing text with accents, CJK characters, or emojis to be
wrapped at incorrect positions.

This commit introduces mbWordwrap(), a custom implementation that uses
mb_strlen() and mb_substr() to properly handle UTF-8 and multibyte
text wrapping in signature images.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add test cases for Portuguese text with accents to verify that the
multibyte-safe wordwrap implementation correctly handles text with
diacritical marks and other Unicode characters in signature images.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@github-project-automation github-project-automation Bot moved this to 0. Needs triage in Roadmap Dec 10, 2025
@backportbot-libresign backportbot-libresign Bot added this to the Next Patch (32) milestone Dec 10, 2025
@vitormattos vitormattos merged commit 4426ae0 into stable32 Dec 10, 2025
62 checks passed
@vitormattos vitormattos deleted the backport/6074/stable32 branch December 10, 2025 17:33
@github-project-automation github-project-automation Bot moved this from 0. Needs triage to 4. to release in Roadmap Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant