-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix bug #81598: Use C.UTF-8 as LC_CTYPE locale by default #7635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Unfortunately, libedit is locale based and does not accept UTF-8 input when the C locale is used. This patch switches the default locale to C.UTF-8 instead (if it is available). This makes libedit work and I believe it shouldn't affect behavior of single-byte locale-dependent functions that PHP otherwise uses.
It might be possible to undo #7333 as well, not sure if that's a separate problem or not. |
@nikic how do you think, will this patch be included in PHP 8.1? |
What's the status here? Are we good with merging into PHP-8.0, or do we first want to merge into PHP-8.1, and cherry-pick later if there are no issues? |
Merging into 8.1 first sounds reasonable to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will allow us to revert the change for #7333; I've tested on 8.0 and the fault goes away when we call zend_reset_lc_ctype_locale before readline.
Might be a good idea to ship these fixes with PHP 8.1.1RC1. cc @ramsey, @patrickallaert |
The bug is still present in PHP-8.0 |
Might be sensible to backport into PHP-8.0 now, given that apparently no issues have been reported so far for PHP-8.1. @diesse, consider to submit a respective pull request. |
Unfortunately, libedit is locale based and does not accept UTF-8
input when the C locale is used. This patch switches the default
locale to C.UTF-8 instead (if it is available). This makes libedit
work and I believe it shouldn't affect behavior of single-byte
locale-dependent functions that PHP otherwise uses.