Subject: PATCH 5.10 documentation
[p5sagit/p5-mst-13.2.git] / t / uni / fold.t
index a068e65..f6f467c 100644 (file)
@@ -9,16 +9,23 @@ my $CF = File::Spec->catfile(File::Spec->catdir(File::Spec->updir,
                                               "lib", "unicore"),
                            "CaseFolding.txt");
 
+use constant EBCDIC => ord 'A' == 193;
+
 if (open(CF, $CF)) {
     my @CF;
 
     while (<CF>) {
-        if (/^([0-9A-F]+); ([CFSI]); ((?:[0-9A-F]+)(?: [0-9A-F]+)*); \# (.+)/) {
-            next if $2 eq 'S'; # we are going for 'F'ull case folding
+       # Skip S since we are going for 'F'ull case folding.  I is obsolete starting
+       # with Unicode 3.2, but leaving it in does no harm, and allows backward
+       # compatibility
+        if (/^([0-9A-F]+); ([CFI]); ((?:[0-9A-F]+)(?: [0-9A-F]+)*); \# (.+)/) {
+           next if EBCDIC && hex $1 < 0x100;
            push @CF, [$1, $2, $3, $4];
        }
     }
 
+    close(CF);
+
     die qq[$0: failed to find casefoldings from "$CF"\n] unless @CF;
 
     print "1..", scalar @CF, "\n";