package Encode::Byte;
+use strict;
+use warnings;
use Encode;
-our $VERSION = do { my @r = ( q$Revision: 2.1 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use XSLoader;
XSLoader::load( __PACKAGE__, $VERSION );
package Encode::CN;
-
BEGIN {
if ( ord("A") == 193 ) {
die "Encode::CN not supported on EBCDIC\n";
}
}
-our $VERSION = do { my @r = ( q$Revision: 2.1 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
-
+use strict;
+use warnings;
use Encode;
+our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use XSLoader;
XSLoader::load( __PACKAGE__, $VERSION );
# Revision history for Perl extension Encode.
#
-# $Id: Changes,v 2.16 2006/05/03 18:24:10 dankogai Exp $
+# $Id: Changes,v 2.17 2006/06/03 20:28:48 dankogai Exp dankogai $
#
-$Revision: 2.16 $ $Date: 2006/05/03 18:24:10 $
+$Revision: 2.17 $ $Date: 2006/06/03 20:28:48 $
+! bin/enc2xs
+ overhauled the -C option
+ - added ascii-ctrl', 'null', 'utf-8-strict' to core
+ - auto-generated Encode::ConfigLocal no longer use v-string for version
+ - now searches modules via File::Find so Encode/JP/Mobile is happy
+! Byte/Byte.pm CN/CN.pm EBCDIC/EBCDIC.pm JP/JP.pm KR/KR.pm Symbol/Symbol.pm
+ use strict added; though all they do is load XS, it's
+ still better a practice
+! *.pm
+ use warnings added to all of them for better practices' sake.
+
+2.17 2006/05/09 17:10:09
! encode.pm
'chin' =~ /^zh_CN|chin(?:a|ese)?$/i is true
but chin is not china or chinese.
package Encode::EBCDIC;
+use strict;
+use warnings;
use Encode;
-our $VERSION = do { my @r = ( q$Revision: 2.1 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use XSLoader;
XSLoader::load( __PACKAGE__, $VERSION );
#
-# $Id: Encode.pm,v 2.17 2006/05/09 17:10:42 dankogai Exp dankogai $
+# $Id: Encode.pm,v 2.18 2006/06/03 20:28:48 dankogai Exp dankogai $
#
package Encode;
use strict;
-our $VERSION = sprintf "%d.%02d", q$Revision: 2.17 $ =~ /(\d+)/g;
+use warnings;
+our $VERSION = sprintf "%d.%02d", q$Revision: 2.18 $ =~ /(\d+)/g;
sub DEBUG () { 0 }
use XSLoader ();
XSLoader::load( __PACKAGE__, $VERSION );
/*
- $Id: Encode.xs,v 2.9 2006/05/03 18:24:10 dankogai Exp $
+ $Id: Encode.xs,v 2.10 2006/06/03 20:28:48 dankogai Exp dankogai $
*/
#define PERL_NO_GET_CONTEXT
package Encode::JP;
-
BEGIN {
if ( ord("A") == 193 ) {
die "Encode::JP not supported on EBCDIC\n";
}
}
+use strict;
+use warnings;
use Encode;
-our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use XSLoader;
XSLoader::load( __PACKAGE__, $VERSION );
package Encode::KR;
-
BEGIN {
if ( ord("A") == 193 ) {
die "Encode::KR not supported on EBCDIC\n";
}
}
-our $VERSION = do { my @r = ( q$Revision: 2.1 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
-
+use strict;
+use warnings;
use Encode;
+our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use XSLoader;
XSLoader::load( __PACKAGE__, $VERSION );
package Encode::Symbol;
+use strict;
+use warnings;
use Encode;
-our $VERSION = do { my @r = ( q$Revision: 2.1 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use XSLoader;
XSLoader::load( __PACKAGE__, $VERSION );
package Encode::TW;
-
BEGIN {
if ( ord("A") == 193 ) {
die "Encode::TW not supported on EBCDIC\n";
}
}
-our $VERSION = do { my @r = ( q$Revision: 2.1 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
-
+use strict;
+use warnings;
use Encode;
+our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use XSLoader;
XSLoader::load( __PACKAGE__, $VERSION );
use warnings;
use Getopt::Std;
my @orig_ARGV = @ARGV;
-our $VERSION = do { my @r = (q$Revision: 2.3 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 2.4 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
# These may get re-ordered.
# RAW is a do_now as inserted by &enter
$_LocalVer
);
-sub make_configlocal_pm
-{
+sub make_configlocal_pm {
eval { require Encode; };
$@ and die "Unable to require Encode: $@\n";
eval { require File::Spec; };
+
# our used for variable expanstion
- my %in_core = map {$_=>1}('ascii','iso-8859-1','utf8');
+ my %in_core = map { $_ => 1 } (
+ 'ascii', 'iso-8859-1', 'utf8',
+ 'ascii-ctrl', 'null', 'utf-8-strict'
+ );
my %LocalMod = ();
- for my $d (@INC){
- my $inc = File::Spec->catfile($d, "Encode");
- -d $inc or next;
- opendir my $dh, $inc or die "$inc:$!";
- warn "Checking $inc...\n";
- for my $f (grep /\.pm$/o, readdir($dh)){
- -f File::Spec->catfile($inc, "$f") or next;
- $INC{"Encode/$f"} and next;
- warn "require Encode/$f;\n";
- eval { require "Encode/$f"; };
- $@ and die "Can't require Encode/$f: $@\n";
- for my $enc (Encode->encodings()){
- no warnings 'once';
- $in_core{$enc} and next;
- $Encode::Config::ExtModule{$enc} and next;
- my $mod = "Encode/$f";
- $mod =~ s/\.pm$//o; $mod =~ s,/,::,og;
- $LocalMod{$enc} ||= $mod;
- }
- }
- }
+ # check @enc;
+ use File::Find ();
+ my $wanted = sub{
+ -f $_ or return;
+ $File::Find::name =~ /\A\./ and return;
+ $File::Find::name =~ /\.pm\z/ or return;
+ $File::Find::name =~ m/\bEncode\b/ or return;
+ my $mod = $File::Find::name;
+ $mod =~ s/.*\bEncode\b/Encode/o;
+ $mod =~ s/\.pm\z//o;
+ $mod =~ s,/,::,og;
+ warn qq{ require $mod;\n};
+ eval qq{ require $mod; };
+ $@ and die "Can't require $mod: $@\n";
+ for my $enc ( Encode->encodings() ) {
+ no warnings;
+ $in_core{$enc} and next;
+ $Encode::Config::ExtModule{$enc} and next;
+ $LocalMod{$enc} ||= $mod;
+ }
+ };
+ File::Find::find({wanted => $wanted}, @INC);
$_ModLines = "";
- for my $enc (sort keys %LocalMod){
- $_ModLines .=
- qq(\$Encode::ExtModule{'$enc'} =\t"$LocalMod{$enc}";\n);
+ for my $enc ( sort keys %LocalMod ) {
+ $_ModLines .=
+ qq(\$Encode::ExtModule{'$enc'} = "$LocalMod{$enc}";\n);
}
warn $_ModLines;
$_LocalVer = _mkversion();
- $_E2X = find_e2x();
- $_Inc = $INC{"Encode.pm"}; $_Inc =~ s/\.pm$//o;
- _print_expand(File::Spec->catfile($_E2X,"ConfigLocal_PM.e2x"),
- File::Spec->catfile($_Inc,"ConfigLocal.pm"),
- 1);
+ $_E2X = find_e2x();
+ $_Inc = $INC{"Encode.pm"};
+ $_Inc =~ s/\.pm$//o;
+ _print_expand( File::Spec->catfile( $_E2X, "ConfigLocal_PM.e2x" ),
+ File::Spec->catfile( $_Inc, "ConfigLocal.pm" ), 1 );
exit;
}
sub _mkversion{
- my ($ss,$mm,$hh,$dd,$mo,$yyyy) = localtime();
- $yyyy += 1900, $mo +=1;
- return sprintf("v%04d.%04d.%04d", $yyyy, $mo*100+$dd, $hh*100+$mm);
+ # v-string is now depreciated; use time() instead;
+ #my ($ss,$mm,$hh,$dd,$mo,$yyyy) = localtime();
+ #$yyyy += 1900, $mo +=1;
+ #return sprintf("v%04d.%04d.%04d", $yyyy, $mo*100+$dd, $hh*100+$mm);
+ return time();
}
sub _print_expand{
-# $Id: encoding.pm,v 2.3 2006/05/03 18:24:10 dankogai Exp $
+# $Id: encoding.pm,v 2.4 2006/06/03 20:28:48 dankogai Exp dankogai $
package encoding;
-our $VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.4 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use Encode;
use strict;
+use warnings;
sub DEBUG () { 0 }
package Encode::Alias;
use strict;
+use warnings;
no warnings 'redefine';
use Encode;
-our $VERSION = do { my @r = ( q$Revision: 2.5 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.6 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
sub DEBUG () { 0 }
use base qw(Exporter);
#
-# $Id: CJKConstants.pm,v 2.1 2006/05/03 18:24:10 dankogai Exp $
+# $Id: CJKConstants.pm,v 2.2 2006/06/03 20:28:48 dankogai Exp dankogai $
#
package Encode::CJKConstants;
use strict;
-
-our $RCSID = q$Id: CJKConstants.pm,v 2.1 2006/05/03 18:24:10 dankogai Exp $;
-our $VERSION = do { my @r = ( q$Revision: 2.1 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+use warnings;
+our $RCSID = q$Id: CJKConstants.pm,v 2.2 2006/06/03 20:28:48 dankogai Exp dankogai $;
+our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use Carp;
package Encode::CN::HZ;
use strict;
+use warnings;
use vars qw($VERSION);
-$VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+$VERSION = do { my @r = ( q$Revision: 2.4 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use Encode qw(:fallbacks);
# Demand-load module list
#
package Encode::Config;
-our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use strict;
+use warnings;
our %ExtModule = (
# Base class for classes which implement encodings
use strict;
-our $VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+use warnings;
+our $VERSION = do { my @r = ( q$Revision: 2.4 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
require Encode;
package Encode::Guess;
use strict;
-
+use warnings;
use Encode qw(:fallbacks find_encoding);
-our $VERSION = do { my @r = ( q$Revision: 2.1 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
my $Canon = 'Guess';
sub DEBUG () { 0 }
#
-# $Id: H2Z.pm,v 2.1 2006/05/03 18:24:10 dankogai Exp $
+# $Id: H2Z.pm,v 2.2 2006/06/03 20:28:48 dankogai Exp dankogai $
#
package Encode::JP::H2Z;
use strict;
+use warnings;
-our $RCSID = q$Id: H2Z.pm,v 2.1 2006/05/03 18:24:10 dankogai Exp $;
-our $VERSION = do { my @r = ( q$Revision: 2.1 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $RCSID = q$Id: H2Z.pm,v 2.2 2006/06/03 20:28:48 dankogai Exp dankogai $;
+our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use Encode::CJKConstants qw(:all);
package Encode::JP::JIS7;
use strict;
-
-our $VERSION = do { my @r = ( q$Revision: 2.1 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+use warnings;
+our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use Encode qw(:fallbacks);
package Encode::KR::2022_KR;
use strict;
-
-our $VERSION = do { my @r = ( q$Revision: 2.1 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+use warnings;
+our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use Encode qw(:fallbacks);
package Encode::MIME::Header;
use strict;
+use warnings;
+no warnings 'redefine';
-# use warnings;
-our $VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.4 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use Encode qw(find_encoding encode_utf8 decode_utf8);
use MIME::Base64;
use Carp;
package Encode::MIME::Header::ISO_2022_JP;
use strict;
+use warnings;
+
use base qw(Encode::MIME::Header);
$Encode::Encoding{'MIME-Header-ISO_2022_JP'} =
use Encode::CJKConstants qw(%RE);
-our $VERSION = do { my @r = ( q$Revision: 1.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 1.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
# I owe the below codes totally to
# Jcode by Dan Kogai & http://www.din.or.jp/~ohzaki/perl.htm#JP_Base64
#
-# $Id: UTF7.pm,v 2.3 2006/05/03 18:24:10 dankogai Exp $
+# $Id: UTF7.pm,v 2.4 2006/06/03 20:28:48 dankogai Exp dankogai $
#
package Encode::Unicode::UTF7;
use strict;
+use warnings;
no warnings 'redefine';
use base qw(Encode::Encoding);
__PACKAGE__->Define('UTF-7');
-our $VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.4 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use MIME::Base64;
use Encode;