diff options
author | Dominic Dunlop <domo@computer.org> | 2000-10-09 16:57:17 +0200 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-10-09 19:18:23 +0000 |
commit | bd62941a3b34eb37eb3da11fbc686756fc23375b (patch) | |
tree | 9210553ec1c0914f88ed8d26aa8008cc3cd1f5c4 /lib/charnames.pm | |
parent | 08413ebc51dcb35b3408023ec04754fc94dff611 (diff) | |
download | perl-bd62941a3b34eb37eb3da11fbc686756fc23375b.tar.gz |
Warn about unknown scripts.
Subject: Re: ideas? patches? [PATCH bleadperl]
Message-Id: <p04320400b6076a75b15f@[192.168.1.4]>
p4raw-id: //depot/perl@7178
Diffstat (limited to 'lib/charnames.pm')
-rw-r--r-- | lib/charnames.pm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/charnames.pm b/lib/charnames.pm index 7c2209b9f0..0ec7ec2d21 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 /; + } + } } |