summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Kogai <dankogai@dan.co.jp>2002-05-07 04:36:15 +0900
committerAbhijit Menon-Sen <ams@wiw.org>2002-05-06 09:48:42 +0000
commit621b0f8dc4f329f12773e6204726adf3d394c032 (patch)
tree9dae9409da36253a6f5e23122a43cd52032a4edb
parent4f7853f45459908f1a46e940a57ba55e0377336b (diff)
downloadperl-621b0f8dc4f329f12773e6204726adf3d394c032.tar.gz
[Encode] 1.70 released
Message-Id: <17AB2CE6-60DD-11D6-9982-00039301D480@dan.co.jp> p4raw-id: //depot/perl@16426
-rw-r--r--ext/Encode/Changes21
-rw-r--r--ext/Encode/Encode.pm4
-rw-r--r--ext/Encode/bin/enc2xs18
-rw-r--r--ext/Encode/encoding.pm21
-rw-r--r--ext/Encode/lib/Encode/Encoding.pm4
-rw-r--r--ext/Encode/t/Unicode.t5
-rw-r--r--ext/Encode/t/mime-header.t2
7 files changed, 51 insertions, 24 deletions
diff --git a/ext/Encode/Changes b/ext/Encode/Changes
index c1a2772ec4..5cd481047e 100644
--- a/ext/Encode/Changes
+++ b/ext/Encode/Changes
@@ -1,9 +1,24 @@
# Revision history for Perl extension Encode.
#
-# $Id: Changes,v 1.69 2002/05/04 16:41:18 dankogai Exp dankogai $
+# $Id: Changes,v 1.70 2002/05/06 10:26:48 dankogai Exp dankogai $
#
-$Revision: 1.69 $ $Date: 2002/05/04 16:41:18 $
+$Revision: 1.70 $ $Date: 2002/05/06 10:26:48 $
+! encoding.pm
+ Made more 'module-safe' with conjunction w/ 'no encoding'.
+ Message-Id: <EAB48C16-60DA-11D6-9982-00039301D480@dan.co.jp>
+! lib/Encode/Encoding.pm
+ 'require Encode' because ->Define uses Encode::define_encoding();
+ problem and solution addressed by Miyagawa-kun
+ Message-Id: <86znzdfvuh.wl@mail.edge.co.jp>
+! t/Unicode.t
+ Cuts the frill to make djgpp happier, as suggested by Laszlo
+ Message-Id: <20020506105819.H17012@libra.eth.ericsson.se>
+! bin/enc2xs
+ enc2xs no longer overwrites files w/ -M option, as suggested by Andreas
+ Message-Id: <m3bsbug48n.fsf@anima.de>
+
+1.69 2002/05/04 16:41:18
! lib/Encode/MIME/Header
Floating-point coerced for UNICOS (in integer arithmetics it folds
line one character too early). Verification by Mark is pending.
@@ -603,7 +618,7 @@ $Revision: 1.69 $ $Date: 2002/05/04 16:41:18 $
Typo fixes and improvements by jhi
Message-Id: <200204010201.FAA03564@alpha.hut.fi>, et al.
-1.11 $Date: 2002/05/04 16:41:18 $
+1.11 $Date: 2002/05/06 10:26:48 $
+ t/encoding.t
+ t/jperl.t
! MANIFEST
diff --git a/ext/Encode/Encode.pm b/ext/Encode/Encode.pm
index 9ad7003f85..20bee0c04c 100644
--- a/ext/Encode/Encode.pm
+++ b/ext/Encode/Encode.pm
@@ -1,9 +1,9 @@
#
-# $Id: Encode.pm,v 1.69 2002/05/04 16:41:18 dankogai Exp dankogai $
+# $Id: Encode.pm,v 1.70 2002/05/06 10:27:11 dankogai Exp dankogai $
#
package Encode;
use strict;
-our $VERSION = do { my @r = (q$Revision: 1.69 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 1.70 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
our $DEBUG = 0;
use XSLoader ();
XSLoader::load(__PACKAGE__, $VERSION);
diff --git a/ext/Encode/bin/enc2xs b/ext/Encode/bin/enc2xs
index 554167ab42..f2287d4675 100644
--- a/ext/Encode/bin/enc2xs
+++ b/ext/Encode/bin/enc2xs
@@ -8,7 +8,7 @@ BEGIN {
use strict;
use Getopt::Std;
my @orig_ARGV = @ARGV;
-our $VERSION = do { my @r = (q$Revision: 1.25 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 1.26 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
# These may get re-ordered.
# RAW is a do_now as inserted by &enter
@@ -888,15 +888,10 @@ sub make_makefile_pl
$_Now = scalar localtime();
eval { require File::Spec; };
- warn "Generating Makefile.PL\n";
_print_expand(File::Spec->catfile($_E2X,"Makefile_PL.e2x"),"Makefile.PL");
- warn "Generating $_Name.pm\n";
_print_expand(File::Spec->catfile($_E2X,"_PM.e2x"), "$_Name.pm");
- warn "Generating t/$_Name.t\n";
_print_expand(File::Spec->catfile($_E2X,"_T.e2x"), "t/$_Name.t");
- warn "Generating README\n";
_print_expand(File::Spec->catfile($_E2X,"README.e2x"), "README");
- warn "Generating t/$_Name.t\n";
_print_expand(File::Spec->catfile($_E2X,"Changes.e2x"), "Changes");
exit;
}
@@ -943,9 +938,9 @@ sub make_configlocal_pm
$_LocalVer = _mkversion();
$_E2X = find_e2x();
$_Inc = $INC{"Encode.pm"}; $_Inc =~ s/\.pm$//o;
- warn "Writing ", File::Spec->catfile($_Inc,"ConfigLocal.pm"), "\n";
_print_expand(File::Spec->catfile($_E2X,"ConfigLocal_PM.e2x"),
- File::Spec->catfile($_Inc,"ConfigLocal.pm"));
+ File::Spec->catfile($_Inc,"ConfigLocal.pm"),
+ 1);
exit;
}
@@ -959,7 +954,12 @@ sub _print_expand{
eval { require File::Basename; };
$@ and die "File::Basename needed. Are you on miniperl?;\nerror: $@\n";
File::Basename->import();
- my ($src, $dst) = @_;
+ my ($src, $dst, $clobber) = @_;
+ if (!$clobber and -e $dst){
+ warn "$dst exists. skipping\n";
+ return;
+ }
+ warn "Generating $dst...\n";
open my $in, $src or die "$src : $!";
if ((my $d = dirname($dst)) ne '.'){
-d $d or mkdir $d, 0755 or die "mkdir $d : $!";
diff --git a/ext/Encode/encoding.pm b/ext/Encode/encoding.pm
index efa5f3113b..0aa5f0f635 100644
--- a/ext/Encode/encoding.pm
+++ b/ext/Encode/encoding.pm
@@ -1,5 +1,5 @@
package encoding;
-our $VERSION = do { my @r = (q$Revision: 1.34 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 1.35 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
use Encode;
use strict;
@@ -75,8 +75,13 @@ sub import {
sub unimport{
no warnings;
undef ${^ENCODING};
+ if ($HAS_PERLIO){
+ binmode(STDIN, ":raw");
+ binmode(STDOUT, ":raw");
+ }else{
binmode(STDIN);
binmode(STDOUT);
+ }
if ($INC{"Filter/Util/Call.pm"}){
eval { filter_del() };
}
@@ -193,10 +198,16 @@ reset to ":raw" (the default unprocessed raw stream of bytes).
=head2 NOT SCOPED
The pragma is a per script, not a per block lexical. Only the last
-C<use encoding> or C<no encoding> matters, and it affects B<the whole script>.
-However, the <no encoding> pragma is supported and C<use encoding> can
-appear as many times as you want in a given script. The multiple use
-of this pragma is discouraged.
+C<use encoding> or C<no encoding> matters, and it affects
+B<the whole script>. However, the <no encoding> pragma is supported and
+B<use encoding> can appear as many times as you want in a given script.
+The multiple use of this pragma is discouraged.
+
+Because of this nature, the use of this pragma inside the module is
+strongly discouraged (because the influence of this pragma lasts not
+only for the module but the script that uses). But if you have to,
+make sure you say C<no encoding> at the end of the module so you
+contain the influence of the pragma within the module.
=head2 DO NOT MIX MULTIPLE ENCODINGS
diff --git a/ext/Encode/lib/Encode/Encoding.pm b/ext/Encode/lib/Encode/Encoding.pm
index 383e0f051c..1876cb73ad 100644
--- a/ext/Encode/lib/Encode/Encoding.pm
+++ b/ext/Encode/lib/Encode/Encoding.pm
@@ -1,7 +1,9 @@
package Encode::Encoding;
# Base class for classes which implement encodings
use strict;
-our $VERSION = do { my @r = (q$Revision: 1.29 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 1.30 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+
+require Encode;
sub Define
{
diff --git a/ext/Encode/t/Unicode.t b/ext/Encode/t/Unicode.t
index bc15aaf216..798419791a 100644
--- a/ext/Encode/t/Unicode.t
+++ b/ext/Encode/t/Unicode.t
@@ -1,5 +1,5 @@
#
-# $Id: Unicode.t,v 1.8 2002/04/16 23:35:00 dankogai Exp $
+# $Id: Unicode.t,v 1.9 2002/05/06 10:26:48 dankogai Exp dankogai $
#
# This script is written entirely in ASCII, even though quoted literals
# do include non-BMP unicode characters -- Are you happy, jhi?
@@ -94,11 +94,10 @@ SKIP: {
$j == 0 and (0xD800 <= $i && $i <= 0xDFFF) and next;
$utf8 .= ord($j+$i);
}
- my $len = length($utf8);
for my $major ('UTF-16', 'UTF-32'){
for my $minor ('BE', 'LE'){
my $enc = $major.$minor;
- is(decode($enc, encode($enc, $utf8)), $utf8, "$enc RT ($len)");
+ is(decode($enc, encode($enc, $utf8)), $utf8, "$enc RT");
}
}
}
diff --git a/ext/Encode/t/mime-header.t b/ext/Encode/t/mime-header.t
index 5da24be5d1..098b639df4 100644
--- a/ext/Encode/t/mime-header.t
+++ b/ext/Encode/t/mime-header.t
@@ -1,5 +1,5 @@
#
-# $Id: mime-header.t,v 1.4 2002/05/04 16:41:18 dankogai Exp dankogai $
+# $Id: mime-header.t,v 1.4 2002/05/04 16:41:18 dankogai Exp $
# This script is written in utf8
#
BEGIN {