From 78fbfaf50141b974bb083befe02344768c783db5 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sat, 24 Aug 2013 12:28:19 -0600 Subject: [PATCH] lib/locale.t: Change debug output This combines the output so that all characters are shown in code point order, with only ASCII alphanumerics displayed literally. This is clearer. --- lib/locale.t | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/locale.t b/lib/locale.t index 4b31d4b..a3b1473 100644 --- a/lib/locale.t +++ b/lib/locale.t @@ -695,7 +695,6 @@ sub display_characters { no locale; my @chars = sort { ord $a <=> ord $b } @_; my $output = ""; - my $hex = ""; my $range_start; my $start_class; push @chars, chr(258); # This sentinel simplifies the loop termination @@ -718,16 +717,17 @@ sub display_characters { elsif ($char =~ /[0-9]/) { $class = 4; } - elsif ($char =~ /[[\]!"#\$\%&\'()*+,.\/:\\;<=>?\@\^_`{|}~-]/) { - $class = -1; # Punct never appears in a range - } + # Uncomment to get literal punctuation displayed instead of hex + #elsif ($char =~ /[[\]!"#\$\%&\'()*+,.\/:\\;<=>?\@\^_`{|}~-]/) { + # $class = -1; # Punct never appears in a range + #} else { $class = 0; # Output in hex } if (! defined $range_start) { if ($class < 0) { - $output .= $char; + $output .= " " . $char; } else { $range_start = ord $char; @@ -747,8 +747,8 @@ sub display_characters { $output .= "-" . chr($range_end) if $range_length > 1; } else { - $hex .= sprintf(" %02X", $range_start); - $hex .= sprintf("-%02X", $range_end) if $range_length > 1; + $output .= sprintf(" %02X", $range_start); + $output .= sprintf("-%02X", $range_end) if $range_length > 1; } # Handle the new current character, as potentially beginning a new @@ -759,8 +759,7 @@ sub display_characters { } $output =~ s/^ //; - $hex =~ s/^ // if ! length $output; - return "$output$hex"; + return $output; } sub report_result { @@ -797,6 +796,7 @@ my %setlocale_failed; # List of locales that setlocale() didn't work on foreach $Locale (@Locale) { $locales_test_number = $first_locales_test_number - 1; + debug "#\n"; debug "# Locale = $Locale\n"; unless (setlocale(&POSIX::LC_ALL, $Locale)) { -- 2.7.4