summaryrefslogtreecommitdiff
path: root/lib/Unicode
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-06-10 05:14:18 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-06-10 05:14:18 +0000
commitae6aa56258ddae4c1d0bf3bf7356f260a4cd9744 (patch)
tree467e60022fc828f494693b28634b0f3b3b144c68 /lib/Unicode
parent1cc95880eb5ad4c99d008c8d29f12d8d907d2d84 (diff)
downloadperl-ae6aa56258ddae4c1d0bf3bf7356f260a4cd9744.tar.gz
Upgrade to Unicode::Collate 0.25.
p4raw-id: //depot/perl@19734
Diffstat (limited to 'lib/Unicode')
-rw-r--r--lib/Unicode/Collate.pm39
-rw-r--r--lib/Unicode/Collate/Changes6
-rw-r--r--lib/Unicode/Collate/README4
-rw-r--r--lib/Unicode/Collate/t/index.t2
-rw-r--r--lib/Unicode/Collate/t/test.t2
5 files changed, 19 insertions, 34 deletions
diff --git a/lib/Unicode/Collate.pm b/lib/Unicode/Collate.pm
index a7538081ae..4be5aabd94 100644
--- a/lib/Unicode/Collate.pm
+++ b/lib/Unicode/Collate.pm
@@ -1,7 +1,7 @@
package Unicode::Collate;
BEGIN {
- unless ("A" eq pack('U', 0x41) || "A" eq pack('U', ord("A"))) {
+ unless ("A" eq pack('U', 0x41)) {
die "Unicode::Collate cannot stringify a Unicode code point\n";
}
}
@@ -14,7 +14,7 @@ use File::Spec;
require Exporter;
-our $VERSION = '0.24';
+our $VERSION = '0.25';
our $PACKAGE = __PACKAGE__;
our @ISA = qw(Exporter);
@@ -111,27 +111,12 @@ sub Base_Unicode_Version { $UNICODE_VERSION || 'unknown' }
######
-use constant UNICODE_FOR_PACK => ("A" eq pack('U', 0x41));
-use constant NATIVE_FOR_PACK => ("A" eq pack('U', ord("A")));
-
-use constant UNICODE_FOR_UNPACK => (0x41 == unpack('U', "A"));
-use constant NATIVE_FOR_UNPACK => (ord("A") == unpack('U', "A"));
-
sub pack_U {
- return UNICODE_FOR_PACK
- ? pack('U*', @_)
- : NATIVE_FOR_PACK
- ? pack('U*', map utf8::unicode_to_native($_), @_)
- : die "$PACKAGE, a Unicode code point cannot be stringified.\n";
+ return pack('U*', @_);
}
sub unpack_U {
- return UNICODE_FOR_UNPACK
- ? unpack('U*', shift)
- : NATIVE_FOR_UNPACK
- ? map(utf8::native_to_unicode($_), unpack 'U*', shift)
- : die "$PACKAGE, a code point returned from unpack U " .
- "cannot be converted into Unicode.\n";
+ return unpack('U*', pack('U*').shift);
}
######
@@ -1206,9 +1191,12 @@ but it is not warned at present.>
-- see 3.2 Default Unicode Collation Element Table, UTS #10.
You can use another element table if desired.
-The table file must be in your C<lib/Unicode/Collate> directory.
+The table file must be put into a directory
+where F<Unicode/Collate.pm> is installed.
+E.g. in F<perl/lib/Unicode/Collate> directory
+when you have F<perl/lib/Unicode/Collate.pm>.
-By default, the file C<lib/Unicode/Collate/allkeys.txt> is used.
+By default, the filename F<"allkeys.txt"> is used.
If C<undef> is passed explicitly as the value for this key,
no file is read (but you can define collation elements via L<entry>).
@@ -1489,13 +1477,6 @@ this module is based on.
None by default.
-=head2 TODO
-
-Unicode::Collate has not been ported to EBCDIC.
-IMHO, use of utf8::unicode_to_native()/utf8::native_to_unicode()
-at the proper postions should allow
-this module to work on EBCDIC platform...
-
=head2 CAVEAT
Use of the C<normalization> parameter requires
@@ -1526,7 +1507,7 @@ SADAHIRO Tomoyuki, E<lt>SADAHIRO@cpan.orgE<gt>
http://homepage1.nifty.com/nomenclator/perl/
- Copyright(C) 2001-2002, SADAHIRO Tomoyuki. Japan. All rights reserved.
+ Copyright(C) 2001-2003, SADAHIRO Tomoyuki. Japan. All rights reserved.
This library is free software; you can redistribute it
and/or modify it under the same terms as Perl itself.
diff --git a/lib/Unicode/Collate/Changes b/lib/Unicode/Collate/Changes
index 2f7b6e75a1..92fdfeb6de 100644
--- a/lib/Unicode/Collate/Changes
+++ b/lib/Unicode/Collate/Changes
@@ -1,4 +1,8 @@
-Revision history for Perl extension Unicode::Collate.
+Revision history for Perl module Unicode::Collate.
+
+0.25 Mon Jun 06 23:20:17 2003
+ - fix Makefile.PL.
+ - internal tweak (again): pack_U() and unpack_U().
0.24 Thu Apr 02 23:12:54 2003
- internal tweak for (?un)pack 'U'.
diff --git a/lib/Unicode/Collate/README b/lib/Unicode/Collate/README
index fc0f68f025..8e4a1533ce 100644
--- a/lib/Unicode/Collate/README
+++ b/lib/Unicode/Collate/README
@@ -1,4 +1,4 @@
-Unicode/Collate version 0.24
+Unicode/Collate version 0.25
===============================
NAME
@@ -54,7 +54,7 @@ SADAHIRO Tomoyuki <SADAHIRO@cpan.org>
http://homepage1.nifty.com/nomenclator/perl/
- Copyright(C) 2001-2002, SADAHIRO Tomoyuki. Japan. All rights reserved.
+ Copyright(C) 2001-2003, SADAHIRO Tomoyuki. Japan. All rights reserved.
This library is free software; you can redistribute it
and/or modify it under the same terms as Perl itself.
diff --git a/lib/Unicode/Collate/t/index.t b/lib/Unicode/Collate/t/index.t
index 550cbe355d..59ad8d7ca8 100644
--- a/lib/Unicode/Collate/t/index.t
+++ b/lib/Unicode/Collate/t/index.t
@@ -1,6 +1,6 @@
BEGIN {
- unless ("A" eq pack('U', 0x41) || "A" eq pack('U', ord("A"))) {
+ unless ("A" eq pack('U', 0x41)) {
print "1..0 # Unicode::Collate " .
"cannot stringify a Unicode code point\n";
exit 0;
diff --git a/lib/Unicode/Collate/t/test.t b/lib/Unicode/Collate/t/test.t
index 502e0b1ac0..9221f5a75f 100644
--- a/lib/Unicode/Collate/t/test.t
+++ b/lib/Unicode/Collate/t/test.t
@@ -1,6 +1,6 @@
BEGIN {
- unless ("A" eq pack('U', 0x41) || "A" eq pack('U', ord("A"))) {
+ unless ("A" eq pack('U', 0x41)) {
print "1..0 # Unicode::Collate " .
"cannot stringify a Unicode code point\n";
exit 0;