X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fcharnames.pm;h=0ec7ec2d21c70c4ca471c478ac583419f97755d3;hb=22d4bb9ccb8701e68f9243547d7e3a3c55f70908;hp=7c2209b9f0966cce8cd9500d3feaf5b0eee35630;hpb=4b19af017623bfa3bb72bb164598a517f586e0d3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/charnames.pm b/lib/charnames.pm index 7c2209b..0ec7ec2 100644 --- a/lib/charnames.pm +++ b/lib/charnames.pm @@ -1,5 +1,6 @@ package charnames; use bytes (); # for $bytes::hint_bits +use warnings(); $charnames::hint_bits = 0x20000; my $txt; @@ -51,6 +52,13 @@ sub import { $^H{charnames_full} = delete $h{':full'}; $^H{charnames_short} = delete $h{':short'}; $^H{charnames_scripts} = [map uc, keys %h]; + if (warnings::enabled('utf8') && @{$^H{charnames_scripts}}) { + $txt = do "unicode/Name.pl" unless $txt; + for (@{$^H{charnames_scripts}}) { + warnings::warn('utf8', "No such script: '$_'") unless + $txt =~ m/\t\t$_ (?:CAPITAL |SMALL )?LETTER /; + } + } }