On 2020/02/22 17:24, Stefan Sperling wrote:
> On Sat, Feb 22, 2020 at 02:56:54PM +0100, Mark Kettenis wrote:
> > IMHO it is a bad idea to make the output of ifconfig locale-dependent.
>
> Fine. I'll drop this diff.
>
Pity, it is quite useful if you are somewhere that uses UTF-8 SSIDs,
otherwise it's a complete pain to decode to figure out if you're
connecting to the correct network. An alternative would be to filter
ifconfig output through something like this
while(<>) {
if ($_ =~ m/nwid 0x([0-9a-f]+)\s/) {
my $hex = $1;
my $decoded = pack "H*", $hex;
$_ =~ s/$hex/$hex ("$decoded")/;
}
print $_;
}
but it won't validate the characters so best redirect output to a file
and open it in a UTF-8 editor to view it rather than displaying it
directly on a terminal.