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

Added the shortened special characters again to make the list mode show up...

Added the shortened special characters again to make the list mode show up nicely; changed 0-255 default to 0-ff (since arguments are now hex)
parent da9b0142
......@@ -43,6 +43,11 @@ while (<$unicode_fh>) {
}
$special{$cp} = $special_name if $name eq '<control>';
}
my %short_special;
@short_special{0 .. 31, 127 .. 159} = qw{
NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US DEL
PAD HOP BPH NBH IND NEL SSA ESA HTS HTJ VTS PLD PLU RI SS2 SS3 DCS PU1 PU2 STS CCH MW SPA EPA SOS SGCI SCI CSI ST OSC PM APC
};
my %format = (
d => "%d",
......@@ -56,14 +61,14 @@ 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; $special{$c} || chr($c) }
c => sub { my $c = shift; $short_special{$c} || chr($c) }
);
my %header = (
d => "Dec",
x => "Hex", X => "Hex", '0x' => "Hex", '0X' => "Hex",
x => "x", X => "X", '0x' => "Hex", '0X' => "Hex",
u => 'U+',
o => 'Oct',
b => 'Binary', '0b' => 'Binary',
......@@ -116,7 +121,7 @@ if ($opts{search} or $opts{regex}) {
}
@ARGV = ('0-255') if not @ARGV;
@ARGV = ('00-ff') if not @ARGV;
my @chars;
for (@ARGV) {
......
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