Skip to content

Commit

Permalink
A much more efficient find-wide-chars.pl
Browse files Browse the repository at this point in the history
  • Loading branch information
leonerd committed Mar 2, 2020
1 parent ece7c45 commit 23adae8
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions find-wide-chars.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@
use strict;
use warnings;

use Unicode::UCD qw( charprop );

STDOUT->autoflush(1);

sub iswide
{
my ( $cp ) = @_;

my $width = charprop( $cp, "East_Asian_Width" ) or return;
return $width eq "Wide" || $width eq "Fullwidth";
return chr($cp) =~ m/\p{East_Asian_Width=Wide}|\p{East_Asian_Width=Fullwidth}/;
}

my ( $start, $end );
Expand Down

0 comments on commit 23adae8

Please sign in to comment.