unicode: stable order of digraph inclusion
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 22 Feb 2015 01:21:01 +0000 (02:21 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 9 Jun 2015 03:43:42 +0000 (05:43 +0200)
Prefer alphabetically lowest mnemonic in case of multiple alternatives
instead of showing random results.

tools/mkcharinfo

index 2c006c5d34fd202cc8aec19648953516796116be..dfcd13de1181478bf9274c29932226a64e17e7c8 100755 (executable)
@@ -54,7 +54,8 @@ my %diinc = (
 for (sort keys %diinc) {
        -e $_ or next;
        my $di = do $_ or die "Error reading digraphs file $_: ", $@ || $!;
 for (sort keys %diinc) {
        -e $_ or next;
        my $di = do $_ or die "Error reading digraphs file $_: ", $@ || $!;
-       while (my ($mnem, $cp) = each %$di) {
+       for my $mnem (sort keys %{$di}) {
+               my $cp = $di->{$mnem};
                length $mnem == 2 or next;  # limit to digraphs
                my $class = $diinc{$_};
                $info{chr $cp}->{di} //= $mnem;
                length $mnem == 2 or next;  # limit to digraphs
                my $class = $diinc{$_};
                $info{chr $cp}->{di} //= $mnem;