… | |
… | |
36 | given ($type) { |
36 | given ($type) { |
37 | when ("disallowed") { |
37 | when ("disallowed") { |
38 | # nop |
38 | # nop |
39 | } |
39 | } |
40 | when (/mapped|deviation|ignored/) { |
40 | when (/mapped|deviation|ignored/) { |
41 | $map .= "\x01" if $type eq "deviation"; |
41 | $map = "\x01$map" if $type eq "deviation"; |
42 | |
42 | |
43 | $imap .= "\x00" . chr . $map |
43 | $imap .= "\x00" . chr . $map |
44 | for $r1 .. $r2 || $r1; |
44 | for $r1 .. $r2 || $r1; |
45 | } |
45 | } |
46 | when ("valid") { |
46 | when ("valid") { |
… | |
… | |
54 | } |
54 | } |
55 | |
55 | |
56 | open my $fh, ">lib/AnyEvent/Util/uts46data.pl" |
56 | open my $fh, ">lib/AnyEvent/Util/uts46data.pl" |
57 | or die; |
57 | or die; |
58 | binmode $fh, ":perlio"; |
58 | binmode $fh, ":perlio"; |
59 | print $fh "# created by gen_uts46data\n"; |
59 | print $fh "# autogenerated by util/gen_uts46data\n"; |
60 | |
60 | |
61 | utf8::encode $imap; |
61 | utf8::encode $imap; |
62 | 0 > index $imap, "\x02" # it's not supposed to be anywhere in there |
62 | 0 > index $imap, "\x02" # it's not supposed to be anywhere in there |
63 | or die "imap contains \\x02"; |
63 | or die "imap contains \\x02"; |
64 | print $fh "\$uts46_imap = q\x02$imap\x00\x02;\n"; |
64 | print $fh "\$uts46_imap = q\x02$imap\x00\x02;\n"; |