summaryrefslogtreecommitdiff
path: root/regen
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-03-06 14:00:10 -0700
committerKarl Williamson <khw@cpan.org>2019-03-06 14:24:13 -0700
commitc11f6329a2001a507b929b443e7512970fe62202 (patch)
treeaecb00063e379eba8331fa591c61e1f41886d399 /regen
parent44289c0b2f08b3d5d540647539cc711c1ba0444c (diff)
downloadperl-c11f6329a2001a507b929b443e7512970fe62202.tar.gz
Check for \n in EBCDIC code pages
IBM says that there are 13 characters whose code point varies depending on the EBCDIC code page. They fail to mention that the \n character may also vary. This commit adds checks for \n, in addition to the checks for the 13 graphic variant ones.
Diffstat (limited to 'regen')
-rw-r--r--regen/charset_translations.pl7
1 files changed, 6 insertions, 1 deletions
diff --git a/regen/charset_translations.pl b/regen/charset_translations.pl
index 75a7046a19..d2a0014557 100644
--- a/regen/charset_translations.pl
+++ b/regen/charset_translations.pl
@@ -207,13 +207,18 @@ sub get_I8_2_utf($) {
# We use all the typical variant characters to construct the #if,
# so that it is unlikely that a different code page will match
# this #if
- for my $char (qw/A \\\ [ ] { } ^ ~ ! # | $ @ `/) {
+ my @variant_chars = qw/A \\\ [ ] { } ^ ~ ! # | $ @ `/;
+ push @variant_chars, "\n";
+ for my $char (@variant_chars) {
my $compare;
my $ascii_ord = ord $char;
my $first_time = $return eq "";
$compare = $ebcdic_translations{$charset}[$ascii_ord];
$return .= " && " unless $first_time;
+ $char = '\n' if $char eq "\n";
+ die "Non-graphical character ord=" . ord($char)
+ if $char !~ /[[:graph:]]/;
$return .= "'$char' == $compare";
$return .= " /* $charset */" if $first_time;
last if $charset eq $ascii_key;