Branch: refs/heads/blead
Home: https://github.com/Perl/perl5
Commit: dd09442b4f520b407d294bebae3aa3d5b4025cc6
https://github.com/Perl/perl5/commit/dd09442b4f520b407d294bebae3aa3d5b4025cc6
Author: Karl Williamson <[email protected]>
Date: 2024-08-14 (Wed, 14 Aug 2024)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Add debugging, work around for Darwin bug
I just discovered that the libc function nl_langinfo() can unexpectedly
return an empty string on z/OS. I added a panic when this happens to
help debug the issue, and found out that an empty string is returnable
on Darwin as well, and who knows on what other platforms. This is not
supposed to happen when the function is given legal inputs, as it is
here.
The behavior is different between the two platforms. So far, Darwin has
only done this for the CODESET query. Doing some debugging on that
platform seems to indicate that the bug is that the OS is only looking
at the locale name to find the codeset, whereas that name can be a
simplified alias for the real locale. The actual codeset requires
actually opening the definition file and reading it. This is something
that glibc, for example, seems to be doing. I have found many instances
on various platforms where the locale name clearly is the wrong codeset,
whereas the one returned by nl_langinfo() is.
A major use internally of nl_langinfo() is to determine if the LC_CTYPE
locale is UTF-8 or not. But there are other methods to determine this
that we already turn to when nl_langinfo() is not available. This is
the first indication I've seen of buggy implementations of this
function. The other methods are reliable. This commit allows a hints
file to indicate that the CODESET part of nl_langinfo() is buggy, and to
use those other methods for UTF8ness determination.
I expect that a non-empty nl_langinfo() return is the correct codeset on
Darwin; it really isn't feasible for perl to bypass the system call
designed to return the desired information and try to get at it
ourselves. Much code doesn't need the actual codeset; just its UTF8ness
is the typical need, so this commit fixes that.
It remains to be seen what else is going on, and on which platforms.
This commit makes the panic display enough information, should it
happen, to indicate a path for debugging.
Commit: df0dd34cc72f566dbf32f671128e0744211cae4d
https://github.com/Perl/perl5/commit/df0dd34cc72f566dbf32f671128e0744211cae4d
Author: Karl Williamson <[email protected]>
Date: 2024-08-14 (Wed, 14 Aug 2024)
Changed paths:
M hints/darwin.sh
Log Message:
-----------
hints/darwin.sh: Enable darwin bug workaround
This workaround was added in the previous commit
Compare: https://github.com/Perl/perl5/compare/a64758401645...df0dd34cc72f
To unsubscribe from these emails, change your notification settings at
https://github.com/Perl/perl5/settings/notifications