Change 14848 by jhi@alpha on 2002/02/23 23:20:57
EBCDIC: disable also Unicode::Collate and
Unicode::Normalize for now. Real users of
EBCDIC have to decide what they want.
Affected files ...
.... //depot/perl/ext/Unicode/Normalize/Normalize.pm#6 edit
.... //depot/perl/ext/Unicode/Normalize/t/func.t#4 edit
.... //depot/perl/ext/Unicode/Normalize/t/norm.t#5 edit
.... //depot/perl/ext/Unicode/Normalize/t/test.t#4 edit
.... //depot/perl/lib/Unicode/Collate.pm#6 edit
.... //depot/perl/lib/Unicode/Collate/t/test.t#5 edit
Differences ...
==== //depot/perl/ext/Unicode/Normalize/Normalize.pm#6 (text) ====
Index: perl/ext/Unicode/Normalize/Normalize.pm
--- perl/ext/Unicode/Normalize/Normalize.pm.~1~ Sat Feb 23 16:30:05 2002
+++ perl/ext/Unicode/Normalize/Normalize.pm Sat Feb 23 16:30:05 2002
@@ -1,5 +1,11 @@
package Unicode::Normalize;
+BEGIN {
+ if (ord("A") == 193) {
+ die "Unicode::Normalize not ported to EBCDIC\n";
+ }
+}
+
use 5.006;
use strict;
use warnings;
@@ -146,6 +152,16 @@
C<normalize> and other some functions: on request.
+=head2 TODO
+
+Unicode::Normalize has not been ported to EBCDIC. The code mostly
+would work just fine but a decision needs to be made: how the module
+should work in EBCDIC? Should the low 256 characters be understood as
+Unicode or as EBCDIC code points? Should one be chosen or should
+there be a way to do either? Or should such translation be left
+outside the module for the user to do, for example by using
+Encode::from_to()?
+
=head1 AUTHOR
SADAHIRO Tomoyuki, E<lt>[EMAIL PROTECTED]<gt>
==== //depot/perl/ext/Unicode/Normalize/t/func.t#4 (text) ====
Index: perl/ext/Unicode/Normalize/t/func.t
--- perl/ext/Unicode/Normalize/t/func.t.~1~ Sat Feb 23 16:30:05 2002
+++ perl/ext/Unicode/Normalize/t/func.t Sat Feb 23 16:30:05 2002
@@ -1,6 +1,13 @@
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'
+BEGIN {
+ if (ord("A") == 193) {
+ print "1..0 # Unicode::Normalize not ported to EBCDIC\n";
+ exit 0;
+ }
+}
+
#########################
use Test;
==== //depot/perl/ext/Unicode/Normalize/t/norm.t#5 (text) ====
Index: perl/ext/Unicode/Normalize/t/norm.t
--- perl/ext/Unicode/Normalize/t/norm.t.~1~ Sat Feb 23 16:30:05 2002
+++ perl/ext/Unicode/Normalize/t/norm.t Sat Feb 23 16:30:05 2002
@@ -1,6 +1,13 @@
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'
+BEGIN {
+ if (ord("A") == 193) {
+ print "1..0 # Unicode::Normalize not ported to EBCDIC\n";
+ exit 0;
+ }
+}
+
#########################
use Test;
==== //depot/perl/ext/Unicode/Normalize/t/test.t#4 (text) ====
Index: perl/ext/Unicode/Normalize/t/test.t
--- perl/ext/Unicode/Normalize/t/test.t.~1~ Sat Feb 23 16:30:05 2002
+++ perl/ext/Unicode/Normalize/t/test.t Sat Feb 23 16:30:05 2002
@@ -1,6 +1,13 @@
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'
+BEGIN {
+ if (ord("A") == 193) {
+ print "1..0 # Unicode::Normalize not ported to EBCDIC\n";
+ exit 0;
+ }
+}
+
#########################
use Test;
@@ -24,24 +31,9 @@
unpack 'U*', NFD pack 'U*', map hex(), split ' ', shift;
}
-my $ordA = ord("A");
-my $ASCII = $ordA == 0x41;
-my $EBCDIC = $ordA == 0xc1;
-
-if ($ASCII) {
- ok(hexNFC("0061 0315 0300 05AE 05C4 0062"), "00E0 05AE 05C4 0315 0062");
- ok(hexNFC("00E0 05AE 05C4 0315 0062"), "00E0 05AE 05C4 0315 0062");
- ok(hexNFC("0061 05AE 0300 05C4 0315 0062"), "00E0 05AE 05C4 0315 0062");
-} elsif ($EBCDIC) {
- # A WITH GRAVE is 0044 in EBCDIC, not 00E0
- # SMALL LATIN B is 0082 in EBCDIC, not 0062
- ok(hexNFC("0061 0315 0300 05AE 05C4 0062"), "0044 05AE 05C4 0315 0082");
- ok(hexNFC("00E0 05AE 05C4 0315 0062"), "0044 05AE 05C4 0315 0082");
- ok(hexNFC("0061 05AE 0300 05C4 0315 0062"), "0044 05AE 05C4 0315 0082");
-} else {
- skip("Neither ASCII nor EBCDIC based") for 1..3;
-}
-
+ok(hexNFC("0061 0315 0300 05AE 05C4 0062"), "00E0 05AE 05C4 0315 0062");
+ok(hexNFC("00E0 05AE 05C4 0315 0062"), "00E0 05AE 05C4 0315 0062");
+ok(hexNFC("0061 05AE 0300 05C4 0315 0062"), "00E0 05AE 05C4 0315 0062");
ok(hexNFC("0045 0304 0300 AC00 11A8"), "1E14 AC01");
ok(hexNFC("1100 1161 1100 1173 11AF"), "AC00 AE00");
ok(hexNFC("1100 0300 1161 1173 11AF"), "1100 0300 1161 1173 11AF");
@@ -49,39 +41,13 @@
ok(hexNFD("0061 0315 0300 05AE 05C4 0062"), "0061 05AE 0300 05C4 0315 0062");
ok(hexNFD("00E0 05AE 05C4 0315 0062"), "0061 05AE 0300 05C4 0315 0062");
ok(hexNFD("0061 05AE 0300 05C4 0315 0062"), "0061 05AE 0300 05C4 0315 0062");
-
-if ($ASCII) {
- ok(hexNFC("0061 05C4 0315 0300 05AE 0062"), "0061 05AE 05C4 0300 0315 0062");
- ok(hexNFC("0061 05AE 05C4 0300 0315 0062"), "0061 05AE 05C4 0300 0315 0062");
-} elsif ($EBCDIC) {
- # SMALL LATIN A is 0081 in EBCDIC, not 0061
- # SMALL LATIN B is 0082 in EBCDIC, not 0062
- ok(hexNFC("0061 05C4 0315 0300 05AE 0062"), "0081 05AE 05C4 0300 0315 0082");
- ok(hexNFC("0061 05AE 05C4 0300 0315 0062"), "0081 05AE 05C4 0300 0315 0082");
-} else {
- skip("Neither ASCII nor EBCDIC based") for 1..2;
-}
-
+ok(hexNFC("0061 05C4 0315 0300 05AE 0062"), "0061 05AE 05C4 0300 0315 0062");
+ok(hexNFC("0061 05AE 05C4 0300 0315 0062"), "0061 05AE 05C4 0300 0315 0062");
ok(hexNFD("0061 05C4 0315 0300 05AE 0062"), "0061 05AE 05C4 0300 0315 0062");
ok(hexNFD("0061 05AE 05C4 0300 0315 0062"), "0061 05AE 05C4 0300 0315 0062");
-
-if ($ASCII) {
- ok(hexNFC("0000 0041 0000 0000"), "0000 0041 0000 0000");
-} elsif ($EBCDIC) {
- # CAPITAL LATIN A is 00C1 in EBCDIC, not 0041
- ok(hexNFC("0000 0041 0000 0000"), "0000 00C1 0000 0000");
-} else {
- skip("Neither ASCII nor EBCDIC based");
-}
-
+ok(hexNFC("0000 0041 0000 0000"), "0000 0041 0000 0000");
ok(hexNFD("0000 0041 0000 0000"), "0000 0041 0000 0000");
# should be unary.
-if ($ASCII) {
- ok(NFC "\x{41}\x{0302}\x{0301}\x62" eq "\x{1EA4}\x62");
-} elsif ($EBCDIC) {
- ok(NFC "\x{41}\x{0302}\x{0301}\x62" eq "\x{1EA4}\x82");
-} else {
- skip("Neither ASCII nor EBCDIC based");
-}
+ok(NFC "\x{41}\x{0302}\x{0301}\x62" eq "\x{1EA4}\x62");
ok(NFD "\x{E0}\x{AC00}" eq "\x{61}\x{0300}\x{1100}\x{1161}");
==== //depot/perl/lib/Unicode/Collate.pm#6 (text) ====
Index: perl/lib/Unicode/Collate.pm
--- perl/lib/Unicode/Collate.pm.~1~ Sat Feb 23 16:30:05 2002
+++ perl/lib/Unicode/Collate.pm Sat Feb 23 16:30:05 2002
@@ -1,5 +1,11 @@
package Unicode::Collate;
+BEGIN {
+ if (ord("A") == 193) {
+ die "Unicode::Collate not ported to EBCDIC\n";
+ }
+}
+
use 5.006;
use strict;
use warnings;
@@ -776,6 +782,16 @@
None by default.
+=head2 TODO
+
+Unicode::Collate has not been ported to EBCDIC. The code mostly would
+work just fine but a decision needs to be made: how the module should
+work in EBCDIC? Should the low 256 characters be understood as
+Unicode or as EBCDIC code points? Should one be chosen or should
+there be a way to do either? Or should such translation be left
+outside the module for the user to do, for example by using
+Encode::from_to()?
+
=head2 CAVEAT
Use of the C<normalization> parameter requires
==== //depot/perl/lib/Unicode/Collate/t/test.t#5 (text) ====
Index: perl/lib/Unicode/Collate/t/test.t
--- perl/lib/Unicode/Collate/t/test.t.~1~ Sat Feb 23 16:30:05 2002
+++ perl/lib/Unicode/Collate/t/test.t Sat Feb 23 16:30:05 2002
@@ -3,6 +3,13 @@
#########################
+BEGIN {
+ if (ord("A") == 193) {
+ print "1..0 # Unicode::Collate not ported to EBCDIC\n";
+ exit 0;
+ }
+}
+
use Test;
BEGIN { plan tests => 54 };
use Unicode::Collate;
End of Patch.