summaryrefslogtreecommitdiff
path: root/t/test.pl
diff options
context:
space:
mode:
authorKarl Williamson <khw@khw-desktop.(none)>2009-11-20 17:14:30 -0700
committerRafael Garcia-Suarez <rgs@consttype.org>2009-11-23 11:43:32 +0100
commit1cfccccd91dcb8384e07fecd6d80c2f1956492ac (patch)
tree63c5899fc1b4b92c6502118a6c02009c56eed68d /t/test.pl
parent02b203e04b3608f934ad6d2d29e54f3c318addb8 (diff)
downloadperl-1cfccccd91dcb8384e07fecd6d80c2f1956492ac.tar.gz
Use hex instead of octal for larger code points
Diffstat (limited to 't/test.pl')
-rw-r--r--t/test.pl11
1 files changed, 10 insertions, 1 deletions
diff --git a/t/test.pl b/t/test.pl
index 7d1a90bb9f..bb27794334 100644
--- a/t/test.pl
+++ b/t/test.pl
@@ -158,7 +158,16 @@ sub display {
$y = $y . $backslash_escape{$c};
} else {
my $z = chr $c; # Maybe we can get away with a literal...
- $z = sprintf "\\%03o", $c if $z =~ /[[:^print:]]/;
+ if ($z =~ /[[:^print:]]/) {
+
+ # Use octal for characters traditionally expressed as
+ # such: the low controls
+ if ($c <= 037) {
+ $z = sprintf "\\%03o", $c;
+ } else {
+ $z = sprintf "\\x{%x}", $c;
+ }
+ }
$y = $y . $z;
}
}