Skip to content

ext/standard: Keep UTF-8 characters together in quoted-printable filters - #26042

Open
iliaal wants to merge 1 commit into
php:PHP-8.4from
iliaal:fix/gh-26041-qp-utf8
Open

iliaal wants to merge 1 commit into
php:PHP-8.4from
iliaal:fix/gh-26041-qp-utf8

Conversation

@iliaal

@iliaal iliaal commented Dec 3, 2026

Copy link
Copy Markdown
Member

The quoted-printable stream filter can insert a soft break between the bytes of a UTF-8 character. The reporter saw Apple Mail drop part of an HTML message when the filter split a nonbreaking space. In text mode, reserve room for the character and the soft-break marker at its leading byte. Binary mode and lines too narrow to hold both keep their existing wrapping.

Fixes GH-26041

In text mode, use the leading byte to reserve space for the whole UTF-8
character and the soft-break marker before emitting its first escape.
The same column count covers reads and writes across stream buckets.
Binary mode and lines too narrow for the character keep folding by octet.

Fixes phpGH-26041
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant