X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/92240b0d1e4434e0981b3326ca4d7ad8673dbf71..3aab2658e078a4f424343fb10817f8d0eab9343b:/rfc1345convert diff --git a/rfc1345convert b/rfc1345convert index f932753..4fd3940 100755 --- a/rfc1345convert +++ b/rfc1345convert @@ -2,6 +2,7 @@ use strict; use warnings; +use utf8; use open OUT => ':utf8', ':std'; use Data::Dumper; @@ -109,7 +110,7 @@ my @extra; if (-r 'shiar.inc.txt') { open my $include, '<:utf8', 'shiar.inc.txt'; for (readline $include) { - m{^([!"%'-Z_a-z]{2}) (.)} or next; + m{^(\$?[!"%'-Z_a-z]{2}) (.)} or next; warn("$1 already defined"), next if defined $di{$1}; $di{$1} = ord $2; push @extra, $1; @@ -149,6 +150,10 @@ for (keys %di) { # show descriptive symbols instead of control chars themselves $info{$_}->{string} = $di{$_} < 32 ? chr($di{$_} + 0x2400) : chr(0xFFFD); } +# presentational string for some control(lish) entries +$info{$_}->{string} = '-' for grep { $di{$_} == 0x00AD } keys %di; +$info{$_}->{string} = '→' for grep { $di{$_} == 0x200E } keys %di; +$info{$_}->{string} = '←' for grep { $di{$_} == 0x200F } keys %di; # convert info hashes into arrays of strings to output in display order for my $row (values %info) {