This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_sys.c: Generalize -B, -T for EBCDIC, clean up
There was discussion about extending these to work for Latin1,
(http://nntp.perl.org/group/perl.perl5.porters/214950 and following)
but in the end it was decided that this is a heuristic, and perturbing
that might break things. So this patch keeps the same criteria as
before, but refactors things so it isn't ASCII-platform-centric.
However, the version it replaces checked for utf8ness piece-meal,
leading to possibly incorrect results, which this fixes. If a buffer
isn't entirely UTF-8, then it can't be UTF-8. So this uses
is_utf8_string() instead of reimplementing the utf8ness checks, and does
it for the buffer as a whole.
And, there was an inapproptiate test for ALPHA under locale that this
removes. The test for locale non-strange characters is that they be
either printable or space (things like \t are space but not printable).