Commit fbc50b66 authored by Jason Rhinelander's avatar Jason Rhinelander
Browse files

Added "n" format that prints the character name

parent dd7d9f37
......@@ -70,7 +70,8 @@ my %format = (
'0Xb' => sub { bytes(encode('utf8', chr shift), '0x', '%02X', '') },
bb => sub { bytes(encode('utf8', chr shift), '', '%08b', '_') },
'0bb' => sub { bytes(encode('utf8', chr shift), '0b', '%08b', '_') },
c => sub { my $c = shift; $short_special{$c} || chr($c) }
c => sub { my $c = shift; $short_special{$c} || chr($c) },
n => sub { my $c = shift; my $info = charinfo($c); $info->{name} || "(unknown)" }
);
......@@ -83,7 +84,8 @@ my %header = (
b => 'Binary', '0b' => 'Binary',
xb => 'HexB', '0xb' => 'HexB', Xb => 'HexB', '0xb' => 'HexB',
bb => 'BinaryB', '0bb' => 'BinaryB',
c => 'C'
c => 'C',
n => 'Name',
);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment