From: Gurusamy Sarathy Date: Wed, 5 Jan 2000 11:25:10 +0000 (+0000) Subject: tweak change#4745 to make ebcdic output match for chars <= 037 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=439481750538dbb51d2e41a78ef67e76929da233;p=p5sagit%2Fp5-mst-13.2.git tweak change#4745 to make ebcdic output match for chars <= 037 p4raw-link: @4745 on //depot/perl: 0407a77bc74fb10c233a2d09d551311e3628eba5 p4raw-id: //depot/perl@4756 --- diff --git a/ext/Data/Dumper/Dumper.pm b/ext/Data/Dumper/Dumper.pm index 1478672..a4aa328 100644 --- a/ext/Data/Dumper/Dumper.pm +++ b/ext/Data/Dumper/Dumper.pm @@ -560,6 +560,7 @@ sub qquote { # no need for 3 digits in escape for these s/([\0-\037])(?!\d)/'\\'.sprintf('%o',ord($1))/eg; s/([\0-\037\177])/'\\'.sprintf('%03o',ord($1))/eg; + # all but last branch below not supported --BEHAVIOR SUBJECT TO CHANGE-- if ($high eq "iso8859") { s/([\200-\240])/'\\'.sprintf('%o',ord($1))/eg; } elsif ($high eq "utf8") { @@ -572,7 +573,10 @@ sub qquote { } } else { # ebcdic - s/([^ !"\#\$%&'()*+,\-.\/0-9:;<=>?\@A-Z[\\\]^_`a-z{|}~])/'\\'.sprintf('%03o',ord($1))/eg; + s{([^ !"\#\$%&'()*+,\-.\/0-9:;<=>?\@A-Z[\\\]^_`a-z{|}~])(?!\d)} + {my $v = ord($1); '\\'.sprintf(($v <= 037 ? '%o' : '%03o'), $v)}eg; + s{([^ !"\#\$%&'()*+,\-.\/0-9:;<=>?\@A-Z[\\\]^_`a-z{|}~])} + {'\\'.sprintf('%03o',ord($1))}eg; } return qq("$_");