Skip to content

[Sync-EN] Add examples for mb_scrub() - #1780

Merged
mmalferov merged 2 commits into
php:masterfrom
lacatoire:sync-en/1712
Sep 21, 2026
Merged

mmalferov merged 2 commits into
php:masterfrom
lacatoire:sync-en/1712

Conversation

@lacatoire

Copy link
Copy Markdown
Member

Syncs reference/mbstring/functions/mb-scrub.xml with php/doc-en#5811.

Adds the two examples and the see-also list:

  • byte-level replacement, using bin2hex() so the actual bytes are visible, showing the default ? substitute and the U+FFFD one set through mb_substitute_character();
  • scrubbing before UTF-8 aware processing, where a /u PCRE pattern fails on ill-formed input and succeeds after the scrub.

The prose and code comments are translated; the preg_last_error_msg() output is left in English, as that is the literal message PHP prints.

EN-Revision bumped to eb10503592351cf78c25be21c60a9049784d57bb.

Fixes: #1712

@lacatoire
lacatoire requested a review from a team as a code owner August 31, 2026 11:00
@mmalferov
mmalferov merged commit 786cafc into php:master Sep 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Sync EN] Add examples for mb_scrub()

2 participants