This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: Bugs? In Unicode::EastAsianWidth.
authorAudrey Tang <cpan@audreyt.org>
Wed, 6 Apr 2005 18:17:32 +0000 (02:17 +0800)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Thu, 7 Apr 2005 09:45:27 +0000 (09:45 +0000)
Message-ID: <20050406101732.GA17931@aut.dyndns.org>

p4raw-id: //depot/perl@24191

lib/unicore/mktables

index c3320ed..e5480ca 100644 (file)
@@ -1242,14 +1242,18 @@ sub EastAsianWidth_txt()
 
     while (<IN>)
     {
-       next unless /^[0-9A-Fa-f]+;/;
+       next unless /^[0-9A-Fa-f]+(\.\.[0-9A-Fa-f]+)?;/;
        s/#.*//;
        s/\s+$//;
 
-       my ($hexcode, $pv) = split(/\s*;\s*/);
-        my $code = hex($hexcode);
+       my ($hexcodes, $pv) = split(/\s*;\s*/);
         $EAW{$pv} ||= Table->New(Is => "EastAsianWidth$pv");
-        $EAW{$pv}->Append($code);
+      my ($start, $end) = split(/\.\./, $hexcodes);
+      if (defined $end) {
+        $EAW{$pv}->AppendRange(hex($start), hex($end));
+      } else {
+        $EAW{$pv}->Append(hex($start));
+      }
     }
     close IN;