ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/util/gen_uts46data
(Generate patch)

Comparing AnyEvent/util/gen_uts46data (file contents):
Revision 1.3 by root, Wed Dec 16 01:22:36 2009 UTC vs.
Revision 1.4 by root, Wed Feb 2 11:27:50 2011 UTC

6use utf8; 6use utf8;
7no warnings 'utf8'; 7no warnings 'utf8';
8 8
9binmode STDOUT, ":utf8"; 9binmode STDOUT, ":utf8";
10 10
11open my $fh, "GET http://www.unicode.org/Public/idna/5.2.0/IdnaMappingTable.txt |" 11open my $fh, "GET http://www.unicode.org/Public/idna/6.0.0/IdnaMappingTable.txt |"
12 or die; 12 or die;
13 13
14my $valid; 14my $valid;
15my $imap; # index map \x00 char replacement 15my $imap; # index map \x00 char replacement
16 16
19 19
20 /^ 20 /^
21 ([0-9A-F]{4,}) (?: \.\.([0-9A-F]{4,}) )? 21 ([0-9A-F]{4,}) (?: \.\.([0-9A-F]{4,}) )?
22 \s*;\s*(\S+) 22 \s*;\s*(\S+)
23 (?: \s*;\s*([0-9A-F ]+?) )? 23 (?: \s*;\s*([0-9A-F ]+?) )?
24 (?: \s*;[^;]+ )?
24 \s* 25 \s*
25 (?: \#.* )? 26 (?: \#.* )?
26 $ 27 $
27 /x or die "$_: unparsable"; 28 /x or die "$_: unparsable";
28 29
32 my $R2 = chr $r2; 33 my $R2 = chr $r2;
33 34
34 $map = join "", map chr hex, split ' ', $map; 35 $map = join "", map chr hex, split ' ', $map;
35 36
36 given ($type) { 37 given ($type) {
37 when ("disallowed") { 38 when (/^(?:disallowed|disallowed_STD3_valid|disallowed_STD3_mapped)$/) {
38 # nop 39 # nop
39 } 40 }
40 when (/mapped|deviation|ignored/) { 41 when (/^(?:mapped|deviation|ignored)$/) {
41 $map = "\x01$map" if $type eq "deviation"; 42 $map = "\x01$map" if $type eq "deviation";
42 43
43 $imap .= "\x00" . chr . $map 44 $imap .= "\x00" . chr . $map
44 for $r1 .. $r2 || $r1; 45 for $r1 .. $r2 || $r1;
45 } 46 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines