From 8079ad8217fc56d7ca13c7f6bae25f75e0762e6a Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 3 Mar 2011 19:02:37 -0700 Subject: [PATCH] UCD.pm: All code points have a script Unassigned code points have the script 'Unknown'; not undef --- lib/Unicode/UCD.pm | 2 +- lib/Unicode/UCD.t | 2 +- pod/perldelta.pod | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Unicode/UCD.pm b/lib/Unicode/UCD.pm index 8b3a944..b15b927 100644 --- a/lib/Unicode/UCD.pm +++ b/lib/Unicode/UCD.pm @@ -586,7 +586,7 @@ sub charscript { if (defined $code) { my $result = _search(\@SCRIPTS, 0, $#SCRIPTS, $code); return $result if defined $result; - #return $utf8::SwashInfo{'ToSc'}{'missing'}; + return $utf8::SwashInfo{'ToSc'}{'missing'}; } elsif (exists $SCRIPTS{$arg}) { return dclone $SCRIPTS{$arg}; } diff --git a/lib/Unicode/UCD.t b/lib/Unicode/UCD.t index dca4c1a..0069751 100644 --- a/lib/Unicode/UCD.t +++ b/lib/Unicode/UCD.t @@ -218,7 +218,7 @@ use Unicode::UCD qw(charblock charscript); # 0x0590 is in the Hebrew block but unused. is(charblock(0x590), 'Hebrew', '0x0590 - Hebrew unused charblock'); -is(charscript(0x590), undef, '0x0590 - Hebrew unused charscript'); +is(charscript(0x590), 'Unknown', '0x0590 - Hebrew unused charscript'); $charinfo = charinfo(0xbe); diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 9bf5821..93ad8ee 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -186,6 +186,11 @@ corrected ones. =back +=item charscript() + +This now correctly returns "Unknown" instead of C for the script +of a code point that hasn't been assigned another one. + =back =back -- 2.7.4