From 23adae8c850d3019445abf72b893e43ed4911132 Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Mon, 2 Mar 2020 18:59:51 +0000 Subject: [PATCH] A much more efficient find-wide-chars.pl --- find-wide-chars.pl | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/find-wide-chars.pl b/find-wide-chars.pl index fc4a2344..f7f22051 100644 --- a/find-wide-chars.pl +++ b/find-wide-chars.pl @@ -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 );