# 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.
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
#
-# $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);
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
$_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;
}
$_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;
}
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 : $!";
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;
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() };
}
=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
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
{
#
-# $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?
$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");
}
}
}
#
-# $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 {