Change 18559 by jhi@kosh on 2003/01/22 13:19:31

        Upgrade to Encode 1.86.

Affected files ...

... //depot/perl/ext/Encode/Changes#46 edit
... //depot/perl/ext/Encode/Encode.pm#125 edit
... //depot/perl/ext/Encode/MANIFEST#38 edit
... //depot/perl/ext/Encode/Unicode/Unicode.xs#10 edit
... //depot/perl/ext/Encode/encoding.pm#18 edit
... //depot/perl/ext/Encode/t/enc_eucjp.t#2 edit
... //depot/perl/ext/Encode/t/enc_utf8.t#3 edit

Differences ...

==== //depot/perl/ext/Encode/Changes#46 (text) ====
Index: perl/ext/Encode/Changes
--- perl/ext/Encode/Changes#45~18478~   Mon Jan 13 15:10:55 2003
+++ perl/ext/Encode/Changes     Wed Jan 22 05:19:31 2003
@@ -1,9 +1,25 @@
 # Revision history for Perl extension Encode.
 #
-# $Id: Changes,v 1.84 2003/01/10 12:00:16 dankogai Exp dankogai $
+# $Id: Changes,v 1.86 2003/01/22 03:29:07 dankogai Exp $
 #
 
-$Revision: 1.84 $ $Date: 2003/01/10 12:00:16 $
+$Revision: 1.86 $ $Date: 2003/01/22 03:29:07 $
+! encoding.pm
+  * Don't forget to canonize when you attempt an exact match!
+  Message-Id: <[EMAIL PROTECTED]>
+  * ${^ENCODING} exception is off for $] > 5.008
+  Message-Id: <[EMAIL PROTECTED]>
+! t/enc_utf8.t
+  $] check commented out so it runs on 5.8.0
+  
+1.85 2003/01/21 22:19:14
+! encoding.pm
+  ${^ENCODING} exception is now explicit rather than handled by regex.
++ t/enc_eucjp.t t/enc_utf8.t
+  Test suite for the better "encoding" pragma support for bleedperl.
+  On 5.8.0, they will just be skipped.
+
+1.84 2003/01/10 12:00:16
 ! encoding.pm
   ${^ENCODING} is no longer set for utf so encoding is no longer fun :)
   (That is to prevent duplicate encoding first by IO then ${^ENCODING})

==== //depot/perl/ext/Encode/Encode.pm#125 (text) ====
Index: perl/ext/Encode/Encode.pm
--- perl/ext/Encode/Encode.pm#124~18478~        Mon Jan 13 15:10:55 2003
+++ perl/ext/Encode/Encode.pm   Wed Jan 22 05:19:31 2003
@@ -1,9 +1,9 @@
 #
-# $Id: Encode.pm,v 1.84 2003/01/10 12:00:16 dankogai Exp dankogai $
+# $Id: Encode.pm,v 1.86 2003/01/22 03:30:40 dankogai Exp $
 #
 package Encode;
 use strict;
-our $VERSION = do { my @r = (q$Revision: 1.84 $ =~ /\d+/g); sprintf "%d."."%02d" x 
$#r, @r };
+our $VERSION = do { my @r = (q$Revision: 1.86 $ =~ /\d+/g); sprintf "%d."."%02d" x 
+$#r, @r };
 our $DEBUG = 0;
 use XSLoader ();
 XSLoader::load(__PACKAGE__, $VERSION);

==== //depot/perl/ext/Encode/Unicode/Unicode.xs#10 (text) ====
Index: perl/ext/Encode/Unicode/Unicode.xs
--- perl/ext/Encode/Unicode/Unicode.xs#9~18483~ Tue Jan 14 16:23:20 2003
+++ perl/ext/Encode/Unicode/Unicode.xs  Wed Jan 22 05:19:31 2003
@@ -1,5 +1,5 @@
 /*
- $Id: Unicode.xs,v 1.6 2003/01/10 12:00:16 dankogai Exp dankogai $
+ $Id: Unicode.xs,v 1.6 2003/01/10 12:00:16 dankogai Exp $
  */
 
 #define PERL_NO_GET_CONTEXT

==== //depot/perl/ext/Encode/encoding.pm#18 (text) ====
Index: perl/ext/Encode/encoding.pm
--- perl/ext/Encode/encoding.pm#17~18496~       Thu Jan 16 12:36:23 2003
+++ perl/ext/Encode/encoding.pm Wed Jan 22 05:19:31 2003
@@ -1,5 +1,5 @@
 package encoding;
-our $VERSION = do { my @r = (q$Revision: 1.38 $ =~ /\d+/g); sprintf "%d."."%02d" x 
$#r, @r };
+our $VERSION = do { my @r = (q$Revision: 1.40 $ =~ /\d+/g); sprintf "%d."."%02d" x 
+$#r, @r };
 
 use Encode;
 use strict;
@@ -17,6 +17,9 @@
     $HAS_PERLIO = (PerlIO::encoding->VERSION >= 0.02);
 }
 
+my %utfs = map {$_=>1}
+    qw(utf8 UCS-2BE UCS-2LE UTF-16 UTF-16BE UTF-16LE UTF-32 UTF-32BE UTF-32LE);
+
 sub import {
     my $class = shift;
     my $name  = shift;
@@ -28,8 +31,9 @@
        require Carp;
        Carp::croak("Unknown encoding '$name'");
     }
+    $name = $enc->name; # canonize
     unless ($arg{Filter}) {
-       ${^ENCODING} = $enc;
+       ${^ENCODING} = $enc unless $] <= 5.008 and $utfs{$name};
        $HAS_PERLIO or return 1;
        for my $h (qw(STDIN STDOUT)){
            if ($arg{$h}){

==== //depot/perl/ext/Encode/t/enc_eucjp.t#2 (text) ====
Index: perl/ext/Encode/t/enc_eucjp.t
--- perl/ext/Encode/t/enc_eucjp.t#1~18496~      Thu Jan 16 12:36:23 2003
+++ perl/ext/Encode/t/enc_eucjp.t       Wed Jan 22 05:19:31 2003
@@ -1,7 +1,12 @@
+# $Id: enc_eucjp.t,v 1.1 2003/01/21 22:19:14 dankogai Exp $
 # This is the twin of enc_utf8.t, the only difference is that
 # this has "use encoding 'euc-jp'".
 
 BEGIN {
+    if ($] <= 5.008){
+       print "1..0 # Skip: Perl 5.8.1 or later required\n";
+       exit 0;
+    }
     require Config; import Config;
     if ($Config{'extensions'} !~ /\bEncode\b/) {
       print "1..0 # Skip: Encode was not built\n";
@@ -30,6 +35,7 @@
   open(F, ">f$i") or die "$0: failed to open 'f$i' for writing: $!";
   binmode(F, ":utf8");
   print F chr($c[$i]);
+  print F pack("C" => $c[$i]);
   close F;
 }
 

==== //depot/perl/ext/Encode/t/enc_utf8.t#3 (text) ====
Index: perl/ext/Encode/t/enc_utf8.t
--- perl/ext/Encode/t/enc_utf8.t#2~18496~       Thu Jan 16 12:36:23 2003
+++ perl/ext/Encode/t/enc_utf8.t        Wed Jan 22 05:19:31 2003
@@ -1,7 +1,12 @@
+# $Id: enc_utf8.t,v 1.2 2003/01/22 03:29:07 dankogai Exp $
 # This is the twin of enc_eucjp.t, the only difference is that
 # this has "use encoding 'utf8'".
 
 BEGIN {
+#     if ($] <= 5.008){
+#      print "1..0 # Skip: Perl 5.8.1 or later required\n";
+#      exit 0;
+#     }
     require Config; import Config;
     if ($Config{'extensions'} !~ /\bEncode\b/) {
       print "1..0 # Skip: Encode was not built\n";
@@ -40,7 +45,7 @@
   binmode(F, ":utf8");
   my $c = <F>;
   my $o = ord($c);
-  print $o == $c[$i] ? "ok $t - utf8 I/O $c[$i]\n" : "not ok $t - utf8 I/O $c[$$i]: 
$o != $c[$i]\n";
+  print $o == $c[$i] ? "ok $t - utf8 I/O $c[$i]\n" : "not ok $t - utf8 I/O $c[$i]: $o 
+!= $c[$i]\n";
   $t++;
 }
 
End of Patch.

Reply via email to