From: Karl Williamson Date: Sat, 21 Nov 2009 00:14:30 +0000 (-0700) Subject: Use hex instead of octal for larger code points X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1cfccccd91dcb8384e07fecd6d80c2f1956492ac;p=p5sagit%2Fp5-mst-13.2.git Use hex instead of octal for larger code points --- diff --git a/t/test.pl b/t/test.pl index 7d1a90b..bb27794 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; } }