Skip to content

[stable31] fix: multibyte text wrapping#6075

Merged
vitormattos merged 2 commits intostable31from
backport/6074/stable31
Dec 10, 2025
Merged

[stable31] fix: multibyte text wrapping#6075
vitormattos merged 2 commits intostable31from
backport/6074/stable31

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 (31) milestone Dec 10, 2025
@vitormattos vitormattos merged commit f0a1840 into stable31 Dec 10, 2025
62 checks passed
@vitormattos vitormattos deleted the backport/6074/stable31 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