summaryrefslogtreecommitdiff
path: root/lib/Unicode/Collate.pm
diff options
context:
space:
mode:
authorSADAHIRO Tomoyuki <BQW10602@nifty.com>2002-05-05 01:07:07 +0900
committerJarkko Hietaniemi <jhi@iki.fi>2002-05-04 16:57:05 +0000
commit3164dd77493d8c6d2197a3faf95daafb93006a96 (patch)
treef06bcd94190e9c75a4ad301a2a8a1efcb669a9b6 /lib/Unicode/Collate.pm
parentfa8a65806e20ffb61be982ce30fb168cdf5716ef (diff)
downloadperl-3164dd77493d8c6d2197a3faf95daafb93006a96.tar.gz
[Unicode::Collate] UCA Version number
Message-Id: <20020504160547.D7E0.BQW10602@nifty.com> p4raw-id: //depot/perl@16398
Diffstat (limited to 'lib/Unicode/Collate.pm')
-rw-r--r--lib/Unicode/Collate.pm45
1 files changed, 44 insertions, 1 deletions
diff --git a/lib/Unicode/Collate.pm b/lib/Unicode/Collate.pm
index 6d6ed32439..e0dfbd39d6 100644
--- a/lib/Unicode/Collate.pm
+++ b/lib/Unicode/Collate.pm
@@ -25,6 +25,29 @@ our @EXPORT = ();
(our $Path = $INC{'Unicode/Collate.pm'}) =~ s/\.pm$//;
our $KeyFile = "allkeys.txt";
+our $UNICODE_VERSION;
+
+{
+ my($f, $fh);
+ foreach my $d (@INC) {
+ use File::Spec;
+ $f = File::Spec->catfile($d, "unicore", "version");
+ if (open($fh, $f)) {
+ chomp($UNICODE_VERSION = <$fh>);
+ close $fh;
+ last;
+ }
+
+ # XXX, Perl 5.6.1
+ $f = File::Spec->catfile($d, "unicode", "Unicode.301");
+ if (open($fh, $f)) {
+ $UNICODE_VERSION = "3.0.1";
+ close $fh;
+ last;
+ }
+ }
+}
+
our $getCombinClass; # coderef for combining class from Unicode::Normalize
use constant Min2 => 0x20; # minimum weight at level 2
@@ -33,6 +56,10 @@ use constant UNDEFINED => 0xFF80; # special value for undefined CE's
our $DefaultRearrange = [ 0x0E40..0x0E44, 0x0EC0..0x0EC4 ];
+sub UCA_Version { "8.0" }
+
+sub Base_Unicode_Version { $UNICODE_VERSION }
+
##
## constructor
##
@@ -809,7 +836,7 @@ these tags doesn't work validly.
=back
-=head2 Other methods
+=head2 Methods for Collation
=over 4
@@ -913,6 +940,22 @@ is primary equal to C<"m>E<252>C<ss">.
=back
+=head2 Other Methods
+
+=over 4
+
+=item UCA_Version
+
+Returns the version number of Unicode Technical Standard 10
+this module consults.
+
+=item Base_Unicode_Version
+
+Returns the version number of the Unicode Standard
+this module is based on.
+
+=back
+
=head2 EXPORT
None by default.