Data-Dumper/Dumper.pm: An EBCDIC fix
authorKarl Williamson <public@khwilliamson.com>
Fri, 5 Apr 2013 18:21:21 +0000 (12:21 -0600)
committerKarl Williamson <public@khwilliamson.com>
Sat, 7 Sep 2013 16:36:08 +0000 (10:36 -0600)
Change the range 0-7F to the portable equivalent [:ascii:]

dist/Data-Dumper/Dumper.pm

index 7bc1ed9..5b31d2c 100644 (file)
@@ -718,7 +718,7 @@ sub qquote {
   local($_) = shift;
   s/([\\\"\@\$])/\\$1/g;
   my $bytes; { use bytes; $bytes = length }
-  s/([^\x00-\x7f])/'\x{'.sprintf("%x",ord($1)).'}'/ge if $bytes > length;
+  s/([[:^ascii:]])/'\x{'.sprintf("%x",ord($1)).'}'/ge if $bytes > length;
   return qq("$_") unless
     /[^ !"\#\$%&'()*+,\-.\/0-9:;<=>?\@A-Z[\\\]^_`a-z{|}~]/;  # fast exit