[php-src] PR #13820: [PoC] Fix GH-13815: mb_trim() inaccurate $characters default value
| From: | nielsdos | Date: | Wed, 27 Mar 2024 21:26:22 +0000 |
| Subject: | [php-src] PR #13820: [PoC] Fix GH-13815: mb_trim() inaccurate $characters default value | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-25556@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/13820
Author: nielsdos
Because the default characters are defined in the stub file, and the stub file is UTF-8 (typically),
the characters are encoded in the string as UTF-8. When using a different character encoding, there
is a mismatch between what mb_trim expects and the UTF-8 encoded string it gets.
One way of solving this is by making the characters argument nullable, which would mean that it
always uses the internal code path that has the unicode codepoints that are defaulted actually
stored as codepoint numbers instead of in a string.
Co-authored-by: @ranvis
**Note: this is a proof-of-concept, not a commitment to this change. It must be discussed on the
mailing list.**