El dom, 22 mar 2026 a las 16:48, Colin Watson (<[email protected]>) escribió:
>
> On Sun, Mar 22, 2026 at 01:52:01AM +0100, Agustin Martin wrote:
> > Most messages come from the bullet operator used by the PTS, so if we
> > try only to keep that quiet, attached patch may help (it changes bullet
> > operator to "o" char). This is not a full fix since maintainers name
> > can have non-ASCII chars and that would trigger a message, but at
> > least should make those messages way more unusual. If we really do not want
> > to unconditionally hardcode UTF-8 it may be an option, with the known
> > problems.
>
> While something like this could help in that limited situation, on
> principle I'm not at all keen on a fix that only helps people whose
> names fit into ASCII.
I have noticed that all wide char messages come from that bullet
operator. Maintainer names with non-ASCII chars do not trigger a
warning, just have those chars rendered wrong in my terminal (with or
without the bullet replacement).
I do not expect many people using grep-excuses from a non UTF8
terminal, so setting output to UTF8 as you propose seems cleaner and
should not be a problem. Another way to set STDOUT to utf8 is
--- grep-excuses.orig 2026-03-21 21:20:18.000000000 +0100
+++ grep-excuses 2026-03-23 17:05:50.310235332 +0100
@@ -27,6 +27,8 @@
use File::Basename;
use File::HomeDir;
+binmode STDOUT, ':encoding(UTF-8)';
+
sub require_friendly ($) {
my ($mod) = @_;
return if eval "require $mod;";
For those curious I am attaching a couple of diffs for other ways I tried.
--- grep-excuses.orig 2026-03-21 21:20:18.000000000 +0100
+++ grep-excuses.text_unidecode 2026-03-21 21:47:15.000000000 +0100
@@ -26,6 +26,7 @@
use Dpkg::Path qw(find_command);
use File::Basename;
use File::HomeDir;
+use Text::Unidecode;
sub require_friendly ($) {
my ($mod) = @_;
@@ -361,7 +362,7 @@
$excuse =~ s@</?[^>]+>@@g;
$excuse =~ s@<@<@g;
$excuse =~ s@>@>@g;
- print " $excuse\n";
+ print " ", unidecode($excuse), "\n";
}
}
--- grep-excuses.orig 2026-03-21 21:20:18.000000000 +0100
+++ grep-excuses.libencode-locale-perl 2026-03-23 17:04:45.587399761 +0100
@@ -26,6 +26,12 @@
use Dpkg::Path qw(find_command);
use File::Basename;
use File::HomeDir;
+use Encode::Locale;
+use Encode;
+
+binmode STDIN, ':encoding(console_in)';
+binmode STDOUT, ':encoding(console_out)';
+binmode STDERR, ':encoding(console_out)';
sub require_friendly ($) {
my ($mod) = @_;
@@ -361,6 +367,7 @@
$excuse =~ s@</?[^>]+>@@g;
$excuse =~ s@<@<@g;
$excuse =~ s@>@>@g;
+ $excuse = encode(locale => $excuse);
print " $excuse\n";
}
}