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
authorKarl Williamson <khw@cpan.org>
Thu, 21 Aug 2014 18:10:39 +0000 (12:10 -0600)
committerKarl Williamson <khw@cpan.org>
Thu, 21 Aug 2014 18:58:38 +0000 (12:58 -0600)
commitf13c8ddbfb6aa3d08ad6f1ea2a66babf3f782cac
treeac06b6ae82d963eb77326bb06fd1301fa8ce9c17
parentd804860bb7ec007e39c7d415aea74dcd39017c2d
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).
pp_sys.c