git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
digraphs: alternate glyph string in include
[sheet.git]
/
rfc1345convert
diff --git
a/rfc1345convert
b/rfc1345convert
index c6131ad9f4034fdd93bde939c878deaa34f717e8..cf2d9379513ef43fb3f2874015b0c7bc5e928eed 100644
(file)
--- a/
rfc1345convert
+++ b/
rfc1345convert
@@
-124,14
+124,15
@@
for (values %info) {
$info{$_}->{category} .= ' Xz' for @extra;
for (keys %di) {
$info{$_}->{category} .= ' Xz' for @extra;
for (keys %di) {
+ $info{$_}->{string} = chr(9676) . chr($di{$_}) if $info{$_}->{combining};
# find control characters (first 32 chars from 0 and 128)
# find control characters (first 32 chars from 0 and 128)
- next
if $di{$_} & ~0b1001_1111
;
+ next
unless ($di{$_} & ~0b1001_1111) == 0 or $di{$_} == 127
;
# rename to something more descriptive
$info{$_}->{name} = $info{$_}->{unicode10}
? '<'.$info{$_}->{unicode10}.'>' # the old name was much more useful
: sprintf('<control U+%04X>', $di{$_}); # at least identify by value
# show descriptive symbols instead of control chars themselves
# rename to something more descriptive
$info{$_}->{name} = $info{$_}->{unicode10}
? '<'.$info{$_}->{unicode10}.'>' # the old name was much more useful
: sprintf('<control U+%04X>', $di{$_}); # at least identify by value
# show descriptive symbols instead of control chars themselves
- $
di{$_} += 0x2400 if $di{$_} < 32
;
+ $
info{$_}->{string} = $di{$_} < 32 ? chr($di{$_} + 0x2400) : chr(0xFFFD)
;
}
# output perl code of hash
}
# output perl code of hash
@@
-141,9
+142,10
@@
printf '(map {$_=>0} qw{%s}),'."\n", join(' ',
map { substr($_, 1, 1).substr($_, 0, 1) } sort keys %di
);
printf "q{%s}=>[%s],\n", $_, join(',',
map { substr($_, 1, 1).substr($_, 0, 1) } sort keys %di
);
printf "q{%s}=>[%s],\n", $_, join(',',
- $di{$_},
# glyph
code point
+ $di{$_},
# original
code point
$info{$_} # optional additional arguments
$info{$_} # optional additional arguments
- ? map {"'$_'"} @{ $info{$_} }{qw/name category script/}
+ ? map {"'$_'"} @{ $info{$_} }{qw/name category script/},
+ $info{$_}->{string} || ()
: ()
) for sort keys %di;
print "}\n";
: ()
) for sort keys %di;
print "}\n";