PocketMine-MP
PocketMine-MP copied to clipboard
Replaced `strtolower` and `strtoupper` functions to `mb_strtolower` and `mb_strtoupper`
Introduction
Currently strtolower and strtoupper changes result according to system locale. This could lead to some bugs listed by the issue below. This pull request replaces every strtolower and strtoupper to mb_strtolower and mb_strtoupper.
Relevant issues
- Fixes #3585
Changes
API changes
None
Behavioural changes
Any code that uses lowercase or uppercase letters now don’t have locale-dependent behavior.
Backwards compatibility
None
Follow-up
None
Tests
- [ ]
This has lots of side effects and potential ramifications that haven't been explored. There is a reason I haven't already done this myself.
This will cause behavioural changes in many areas, particularly where non-ASCII encodings are involved, since they'll start getting transformed in ways that wasn't anticipated when the code was written. A more conservative approach would be to use US-ASCII for the encoding parameters.
Done
This is now obsoleted by PHP 8.2, which made the standard library string manipulation functions locale-unaware (manipulating ASCII only).