Re: mb_scrub() is affected by mb_substitute_character()
| From: | Nick Lockheart | Date: | Mon, 05 Aug 2024 14:47:50 +0000 |
| Subject: | Re: mb_scrub() is affected by mb_substitute_character() | ||
| References: | 1 2 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969388395@lists.php.net to get a copy of this message | ||
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:
> >
> >
> > https://www.php.net/manual/en/function.mb-substitute-character.php
>
> Thank you!
>
> Can you please file a ticket at
> <https://github.com/php/doc-en/issues>
> 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/