Fix mb_string issue for multiple locales #235
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For specific locales, the '8BIT' encoding is undefined. The '8bit'
encoding however, is defined for all locales. When this encoding is used
for a locale that does not support it, the runtime will exit with a
fatal error.
This issue does not occur often, only when the relevant locales have
been generated and are loaded using
setlocale
. Below is a testscriptwhich can be used to verify this for all installed locales. Note, before
testing, ensure that all (relevant) locales have been generated,
otherwise the testscript will not show expected output.
This was tested on Ubuntu 20.10 and Arch (both up-to-date) for php
7.0 through 8.0 for all locales. The following locales where found to be
not working as expected:
This can be tested using docker:
docker run --rm -v $(pwd):/test php:7.0 bash -c 'apt update -qqq; apt install locales-all -y -qqq; php /test/test.php'
This also fixes the issue reported in #232 and perhaps the issue reported in #200.