This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix isASCII for EBCDIC
Prior to this commit isASCII on EBCDIC platforms was defined as the
isascii() libc function. It turns out that this doesn't work properly.
It needed to be this way back when EBCDIC was bootstrapped onto the
target machine, but now, various header files are furnished with the
requisite definitions, so this is no longer necessary.
The problem with isascii() is that it is locale-dependent, unlike on
ASCII platforms. This means that instead of getting a standard ASCII
definition, it returns whatever the underlying locale says, even if
there is no 'use locale' anywhere in the program. Starting with this
commit, the isASCII definition now comes from the l1_char_class_tab.h
file which we know is accurate and not locale-dependent.
This header can be used in compilations of utility programs where perl.h
is not available. For these, there are alternate, more complicated
definitions, should they be needed in those utility programs. Several
of those definitions prior to this commit also used locale-sensitive
isfoo() functions. The bulk of this commit refactors those definitions
to not use these functions as much as possible. As noted in the
added comments in the code, the one remaining use of such a function is
only for the lesser-used control characters. Likely these aren't used
in the utility programs.