In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/1cfccccd91dcb8384e07fecd6d80c2f1956492ac?hp=02b203e04b3608f934ad6d2d29e54f3c318addb8>

- Log -----------------------------------------------------------------
commit 1cfccccd91dcb8384e07fecd6d80c2f1956492ac
Author: Karl Williamson <k...@khw-desktop.(none)>
Date:   Fri Nov 20 17:14:30 2009 -0700

    Use hex instead of octal for larger code points
-----------------------------------------------------------------------

Summary of changes:
 t/test.pl |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

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;
                 }
             }

--
Perl5 Master Repository

Reply via email to