/[suikacvs]/perl/lib/Encode/Table/tool/tbl2ucm.pl
Suika

Contents of /perl/lib/Encode/Table/tool/tbl2ucm.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Tue Mar 14 04:47:32 2006 UTC (20 years, 4 months ago) by wakaba
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +9 -2 lines
File MIME type: text/plain
Multibytes are not supported

1 wakaba 1.1 #!/usr/bin/perl
2     use strict;
3    
4 wakaba 1.2 =head1 NAME
5    
6     tbl2ucm --- PETBL/1.0 -> ucm converter
7    
8     =cut
9    
10 wakaba 1.1 my @l;
11     my %i;
12     while (<>) {
13     if (/^0x([0-9A-F]+)\tU\+([0-9A-F]+)\t([^\t]*)\t# ?(.*)/) {
14     push @l, {local => hex $1, ucs => hex $2, comment => $4};
15     my $info = $3;
16     if ($info =~ /<->/) { $l[-1]->{fallback} = 0 }
17     elsif ($info =~ /<-/) { $l[-1]->{fallback} = 1 }
18     elsif ($info =~ /->/) { $l[-1]->{fallback} = 3 }
19 wakaba 1.3 } elsif (/^#\?o ([a-z0-9:_<>-]+)="(.+)"/) {
20     my ($n,$v) = ($1,$2); $v =~ s/\\(.)/$1/g;
21     $i{$n} = $i{$n} ? $i{$n} . "\t" . $v : $v;
22     } elsif (/^## ([a-z0-9:_<>-]+)\t(.+)/) {