# # # patch "lib/perl/Annotate.pm" # from [4b4766bf05dbb8895984aebfe26e0d7c7d1ce25b] # to [9805aae5c5ac9cd9e650e99d3f928687cd6067b4] # # patch "lib/perl/Common.pm" # from [1792ecc74728f8d91f6c5e22fccf58fee301d8d3] # to [37679826b5a267078ecc14a5b47eb42eb6733f33] # # patch "lib/perl/History.pm" # from [676fd21d0cbbe57c42caba1188ede42cd870e692] # to [6ebebca72639a26c112139b03876edd543ab7c9d] # ============================================================ --- lib/perl/Annotate.pm 4b4766bf05dbb8895984aebfe26e0d7c7d1ce25b +++ lib/perl/Annotate.pm 9805aae5c5ac9cd9e650e99d3f928687cd6067b4 @@ -121,7 +121,8 @@ sub display_annotation($$$) $instance->{file_name}); # Find the longest line for future padding and also split each line into - # their prefix and text parts. + # their prefix and text parts. Please note that the use of unpack un-utf8s + # the returned strings. $max_len = 0; if (scalar(@lines) > 0) @@ -136,6 +137,8 @@ sub display_annotation($$$) for ($i = 0; $i < scalar(@lines); ++ $i) { ($prefix[$i], $lines[$i]) = (unpack($template, $lines[$i]))[0, 2]; + $prefix[$i] = decode_utf8($prefix[$i]); + $lines[$i] = decode_utf8($lines[$i]); $lines[$i] =~ s/\s+$//; $lines[$i] = expand($lines[$i]); $max_len = $len if (($len = length($lines[$i])) > $max_len); ============================================================ --- lib/perl/Common.pm 1792ecc74728f8d91f6c5e22fccf58fee301d8d3 +++ lib/perl/Common.pm 37679826b5a267078ecc14a5b47eb42eb6733f33 @@ -184,6 +184,7 @@ sub run_command($@) eval { $pid = open3($fd_in, $fd_out, $fd_err, @args); + binmode($fd_out, ":utf8"); }; # Check for errors (remember that open3() errors can happen in both the ============================================================ --- lib/perl/History.pm 676fd21d0cbbe57c42caba1188ede42cd870e692 +++ lib/perl/History.pm 6ebebca72639a26c112139b03876edd543ab7c9d @@ -602,7 +602,8 @@ sub display_revision_comparison($$$;$) # Find the longest line for future padding, having expanded tabs # (except for file details lines as tab is used as a separator (these - # are expanded later)). + # are expanded later)). Please note that the use of unpack un-utf8s the + # returned strings. $max_len = $separator = 0; foreach my $line (@lines) @@ -620,6 +621,8 @@ sub display_revision_comparison($$$;$) else { ($char, $rest) = unpack("a1a*", $line); + $char = decode_utf8($char); + $rest = decode_utf8($rest); $rest =~ s/\s+$//; $rest = expand($rest); $max_len = $len if (($len = length($rest)) > $max_len);