mb_scrub() is affected by mb_substitute_character()

Hi all,

`mb_substitute_character()` also applies to `mb_scrub()`, but the
documentation doesn't list `mb_scrub()` as being affected:

Nick

On 05.08.2024 at 16:01, Nick Lockheart wrote:

`mb_substitute_character()` also applies to `mb_scrub()`, but the
documentation doesn't list `mb_scrub()` as being affected:

PHP: mb_substitute_character - Manual

Thank you!

Can you please file a ticket at <https://github.com/php/doc-en/issues&gt;
about this?

Christoph

On Mon, 2024-08-05 at 16:39 +0200, Christoph M. Becker wrote:

On 05.08.2024 at 16:01, Nick Lockheart wrote:

> `mb_substitute_character()` also applies to `mb_scrub()`, but the
> documentation doesn't list `mb_scrub()` as being affected:
>
> PHP: mb_substitute_character - Manual

Thank you!

Can you please file a ticket at
<https://github.com/php/doc-en/issues&gt;
about this?

Christoph

Hi Christoph,

Not sure where to bring this up at, but `mb_scrub()` replaces invalid
characters with a standard `?`, but really should use the Unicode
Substitution Character (`0xFFFD`) by default.

Since `mb_substitute_character(0xFFFD);` changes the output of
`mb_scrub()` from `?` to `0xFFFD`, it may be that the default
substitute character is `?` where it should be `0xFFFD` per
https://www.unicode.org/reports/tr36/