git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
todo update
[sheet.git]
/
rfc1345convert
diff --git
a/rfc1345convert
b/rfc1345convert
index cf2d9379513ef43fb3f2874015b0c7bc5e928eed..3157e040065776dade692d6ab0729ce84807c4cf 100644
(file)
--- a/
rfc1345convert
+++ b/
rfc1345convert
@@
-135,6
+135,13
@@
for (keys %di) {
$info{$_}->{string} = $di{$_} < 32 ? chr($di{$_} + 0x2400) : chr(0xFFFD);
}
$info{$_}->{string} = $di{$_} < 32 ? chr($di{$_} + 0x2400) : chr(0xFFFD);
}
+# convert info hashes into arrays of strings to output in display order
+for my $row (values %info) {
+ $row = [ map { $row->{$_} } qw/name category script string/ ];
+ # strip off trailing missing values (especially string may be unknown)
+ defined $row->[-1] ? last : pop @$row for 1 .. @$row;
+}
+
# output perl code of hash
# (assume no backslashes or curlies, so we can just q{} w/o escaping)
print "+{\n";
# output perl code of hash
# (assume no backslashes or curlies, so we can just q{} w/o escaping)
print "+{\n";
@@
-144,8
+151,7
@@
printf '(map {$_=>0} qw{%s}),'."\n", join(' ',
printf "q{%s}=>[%s],\n", $_, join(',',
$di{$_}, # original code point
$info{$_} # optional additional arguments
printf "q{%s}=>[%s],\n", $_, join(',',
$di{$_}, # original code point
$info{$_} # optional additional arguments
- ? map {"'$_'"} @{ $info{$_} }{qw/name category script/},
- $info{$_}->{string} || ()
+ ? map {"'$_'"} @{ $info{$_} }
: ()
) for sort keys %di;
print "}\n";
: ()
) for sort keys %di;
print "}\n";