diff options
-rwxr-xr-x | Porting/Maintainers.pl | 2 | ||||
-rw-r--r-- | cpan/Encode/Changes | 29 | ||||
-rw-r--r-- | cpan/Encode/Encode.pm | 13 | ||||
-rw-r--r-- | cpan/Encode/Encode/Makefile_PL.e2x | 7 | ||||
-rw-r--r-- | cpan/Encode/META.json | 4 | ||||
-rw-r--r-- | cpan/Encode/META.yml | 4 | ||||
-rw-r--r-- | cpan/Encode/Makefile.PL | 4 | ||||
-rw-r--r-- | cpan/Encode/encoding.pm | 12 | ||||
-rw-r--r-- | cpan/Encode/lib/Encode/GSM0338.pm | 2 | ||||
-rw-r--r-- | cpan/Encode/lib/Encode/Supported.pod | 4 | ||||
-rw-r--r-- | cpan/Encode/t/Encode.t | 13 | ||||
-rw-r--r-- | cpan/Encode/t/Mod_EUCJP.pm | 3 | ||||
-rw-r--r-- | cpan/Encode/t/enc_data.t | 3 | ||||
-rw-r--r-- | cpan/Encode/t/enc_eucjp.t | 3 | ||||
-rw-r--r-- | cpan/Encode/t/enc_module.t | 3 | ||||
-rw-r--r-- | cpan/Encode/t/enc_utf8.t | 3 | ||||
-rw-r--r-- | cpan/Encode/t/encoding.t | 1 | ||||
-rw-r--r-- | cpan/Encode/t/jperl.t | 3 | ||||
-rw-r--r-- | cpan/Encode/t/piconv.t | 6 | ||||
-rw-r--r-- | t/op/concat2.t | 1 |
20 files changed, 90 insertions, 30 deletions
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index b990bc36ac..08132fa712 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -636,7 +636,7 @@ use File::Glob qw(:case); 'Encode' => { 'MAINTAINER' => 'dankogai', - 'DISTRIBUTION' => 'DANKOGAI/Encode-2.47.tar.gz', + 'DISTRIBUTION' => 'DANKOGAI/Encode-2.48.tar.gz', 'FILES' => q[cpan/Encode], 'UPSTREAM' => 'cpan', }, diff --git a/cpan/Encode/Changes b/cpan/Encode/Changes index 8f8f7df6bd..36d3880893 100644 --- a/cpan/Encode/Changes +++ b/cpan/Encode/Changes @@ -1,8 +1,33 @@ # Revision history for Perl extension Encode. # -# $Id: Changes,v 2.47 2012/08/15 05:36:16 dankogai Exp dankogai $ +# $Id: Changes,v 2.48 2013/02/18 02:23:56 dankogai Exp dankogai $ # -$Revision: 2.47 $ $Date: 2012/08/15 05:36:16 $ +$Revision: 2.48 $ $Date: 2013/02/18 02:23:56 $ +! encoding.pm + t/Mod_EUCJP.pm t/enc_data.t t/enc_eucjp.t t/enc_module.t t/enc_utf8.t + t/encoding.t t/jperl.t + [PATCH] Deprecate encoding.pm + https://rt.cpan.org/Ticket/Display.html?id=81255 +! Encode/Supported.pod + Fixed: Pod errors + https://rt.cpan.org/Ticket/Display.html?id=81426 +! Encode.pm t/Encode.t + [PATCH] Fix for shared hash key scalars + https://rt.cpan.org/Ticket/Display.html?id=80608 +! Encode.pm + Fixed: Uninitialized value warning from Encode->encodings() + https://rt.cpan.org/Ticket/Display.html?id=80181 +! Makefile.PL + Install to 'site' instead of 'perl' when perl version is 5.11+ + https://rt.cpan.org/Ticket/Display.html?id=78917 +! Encode/Makefile_PL.e2x + find enc2xs.bat if it works on windows. + https://github.com/dankogai/p5-encode/pull/7 +! t/piconv.t + Fix finding piconv in t/piconv.t + https://github.com/dankogai/p5-encode/pull/6 + +2.47 2012/08/15 05:36:16 ! Encode.pm POD Fixes: Copyright and mail address ! Makefile.PL diff --git a/cpan/Encode/Encode.pm b/cpan/Encode/Encode.pm index ff7e0de17d..fa78d68b37 100644 --- a/cpan/Encode/Encode.pm +++ b/cpan/Encode/Encode.pm @@ -1,10 +1,10 @@ # -# $Id: Encode.pm,v 2.47 2012/08/15 05:36:16 dankogai Exp dankogai $ +# $Id: Encode.pm,v 2.48 2013/02/18 02:23:56 dankogai Exp dankogai $ # package Encode; use strict; use warnings; -our $VERSION = sprintf "%d.%02d", q$Revision: 2.47 $ =~ /(\d+)/g; +our $VERSION = sprintf "%d.%02d", q$Revision: 2.48 $ =~ /(\d+)/g; use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG}; use XSLoader (); XSLoader::load( __PACKAGE__, $VERSION ); @@ -62,7 +62,8 @@ eval { sub encodings { my %enc; - if ( @_ and $_[1] eq ":all" ) { + my $arg = $_[1] || ''; + if ( $arg eq ":all" ) { %enc = ( %Encoding, %ExtModule ); } else { @@ -145,7 +146,7 @@ sub clone_encoding($) { sub encode($$;$) { my ( $name, $string, $check ) = @_; return undef unless defined $string; - $string .= '' if ref $string; # stringify; + $string .= ''; # stringify; $check ||= 0; unless ( defined $name ) { require Carp; @@ -165,7 +166,7 @@ sub encode($$;$) { sub decode($$;$) { my ( $name, $octets, $check ) = @_; return undef unless defined $octets; - $octets .= '' if ref $octets; + $octets .= ''; $check ||= 0; my $enc = find_encoding($name); unless ( defined $enc ) { @@ -797,7 +798,7 @@ constants via C<use Encode qw(:fallback_all)>. Encode::LEAVE_SRC If the C<Encode::LEAVE_SRC> bit is I<not> set but I<CHECK> is set, then the -second argument to encode() or decode() will be overwritten in place. +source string to encode() or decode() will be overwritten in place. If you're not interested in this, then bitwise-OR it with the bitmask. =head2 coderef for CHECK diff --git a/cpan/Encode/Encode/Makefile_PL.e2x b/cpan/Encode/Encode/Makefile_PL.e2x index 1d83a2fbda..ece58830fe 100644 --- a/cpan/Encode/Encode/Makefile_PL.e2x +++ b/cpan/Encode/Encode/Makefile_PL.e2x @@ -17,12 +17,17 @@ my %tables = ( #### DO NOT EDIT BEYOND THIS POINT! require File::Spec; my ($enc2xs, $encode_h) = (); +my @path_ext = (''); +@path_ext = split(';', $ENV{PATHEXT}) if $^O eq 'MSWin32'; PATHLOOP: for my $d (@Config{qw/bin sitebin vendorbin/}, (split /$Config{path_sep}/o, $ENV{PATH})){ for my $f (qw/enc2xs enc2xs5.7.3/){ my $path = File::Spec->catfile($d, $f); - -r $path and $enc2xs = $path and last PATHLOOP; + for my $ext (@path_ext) { + my $bin = "$path$ext"; + -r "$bin" and $enc2xs = $bin and last PATHLOOP; + } } } $enc2xs or die "enc2xs not found!"; diff --git a/cpan/Encode/META.json b/cpan/Encode/META.json index 80ef7b7211..be0c1d2202 100644 --- a/cpan/Encode/META.json +++ b/cpan/Encode/META.json @@ -4,7 +4,7 @@ "unknown" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 6.6302, CPAN::Meta::Converter version 2.120921", + "generated_by" : "ExtUtils::MakeMaker version 6.64, CPAN::Meta::Converter version 2.120921", "license" : [ "perl_5" ], @@ -35,5 +35,5 @@ } }, "release_status" : "stable", - "version" : "2.47" + "version" : "2.48" } diff --git a/cpan/Encode/META.yml b/cpan/Encode/META.yml index cf556fa4ac..ddbaaeca90 100644 --- a/cpan/Encode/META.yml +++ b/cpan/Encode/META.yml @@ -7,7 +7,7 @@ build_requires: configure_requires: ExtUtils::MakeMaker: 0 dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 6.6302, CPAN::Meta::Converter version 2.120921' +generated_by: 'ExtUtils::MakeMaker version 6.64, CPAN::Meta::Converter version 2.120921' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -18,4 +18,4 @@ no_index: - t - inc requires: {} -version: 2.47 +version: 2.48 diff --git a/cpan/Encode/Makefile.PL b/cpan/Encode/Makefile.PL index f12f02d1ca..fab6914ff7 100644 --- a/cpan/Encode/Makefile.PL +++ b/cpan/Encode/Makefile.PL @@ -1,5 +1,5 @@ # -# $Id: Makefile.PL,v 2.9 2012/08/15 05:36:16 dankogai Exp dankogai $ +# $Id: Makefile.PL,v 2.10 2013/02/18 02:23:56 dankogai Exp dankogai $ # use 5.007003; use strict; @@ -45,7 +45,7 @@ WriteMakefile( INC => '-I' . File::Spec->catfile( '.', 'Encode' ), LICENSE => 'perl', PMLIBDIRS => \@pmlibdirs, - INSTALLDIRS => 'perl', + INSTALLDIRS => ($] < 5.011 ? 'perl' : 'site'), ); package MY; diff --git a/cpan/Encode/encoding.pm b/cpan/Encode/encoding.pm index 61144e38a9..3761698b91 100644 --- a/cpan/Encode/encoding.pm +++ b/cpan/Encode/encoding.pm @@ -1,4 +1,4 @@ -# $Id: encoding.pm,v 2.10 2012/08/05 23:08:49 dankogai Exp $ +# $Id: encoding.pm,v 2.11 2013/02/18 02:23:56 dankogai Exp dankogai $ package encoding; our $VERSION = '2.6_01'; @@ -102,6 +102,10 @@ sub _get_locale_encoding { } sub import { + if ($] >= 5.017) { + warnings::warnif("deprecated", + "Use of the encoding pragma is deprecated") + } my $class = shift; my $name = shift; if (!$name){ @@ -203,6 +207,12 @@ __END__ encoding - allows you to write your script in non-ascii or non-utf8 +=head1 WARNING + +This module is deprecated under perl 5.18. It uses a mechanism provided by +perl that is deprecated under 5.18 and higher, and may be removed in a +future version. + =head1 SYNOPSIS use encoding "greek"; # Perl like Greek to you? diff --git a/cpan/Encode/lib/Encode/GSM0338.pm b/cpan/Encode/lib/Encode/GSM0338.pm index 381d5a42f9..aeff637978 100644 --- a/cpan/Encode/lib/Encode/GSM0338.pm +++ b/cpan/Encode/lib/Encode/GSM0338.pm @@ -1,5 +1,5 @@ # -# $Id: GSM0338.pm,v 2.2 2012/08/15 05:36:16 dankogai Exp dankogai $ +# $Id: GSM0338.pm,v 2.2 2012/08/15 05:36:16 dankogai Exp $ # package Encode::GSM0338; diff --git a/cpan/Encode/lib/Encode/Supported.pod b/cpan/Encode/lib/Encode/Supported.pod index e84faafd9e..8efa4ff6f8 100644 --- a/cpan/Encode/lib/Encode/Supported.pod +++ b/cpan/Encode/lib/Encode/Supported.pod @@ -94,7 +94,7 @@ To find how (UCS-2|UTF-(16|32))(LE|BE)? differ from one another, see L<Encode::Unicode>. UTF-7 is a special encoding which "re-encodes" UTF-16BE into a 7-bit -encoding. It is implemented seperately by Encode::Unicode::UTF7. +encoding. It is implemented separately by Encode::Unicode::UTF7. =head2 Encode::Byte -- Extended ASCII @@ -420,7 +420,7 @@ at L<http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/> . =item (Mac) Indic encodings The maps for the following are available at L<http://www.unicode.org/> -but remain unsupport because those encodings need algorithmical +but remain unsupported because those encodings need an algorithmical approach, currently unsupported by F<enc2xs>: MacDevanagari diff --git a/cpan/Encode/t/Encode.t b/cpan/Encode/t/Encode.t index 369557ef1d..918975eb4c 100644 --- a/cpan/Encode/t/Encode.t +++ b/cpan/Encode/t/Encode.t @@ -25,7 +25,7 @@ my @character_set = ('0'..'9', 'A'..'Z', 'a'..'z'); my @source = qw(ascii iso8859-1 cp1250); my @destiny = qw(cp1047 cp37 posix-bc); my @ebcdic_sets = qw(cp1047 cp37 posix-bc); -plan test => 38+$n*@encodings + 2*@source*@destiny*@character_set + 2*@ebcdic_sets*256 + 6 + 2; +plan test => 38+$n*@encodings + 2*@source*@destiny*@character_set + 2*@ebcdic_sets*256 + 6 + 4; my $str = join('',map(chr($_),0x20..0x7E)); my $cpy = $str; ok(length($str),from_to($cpy,'iso8859-1','Unicode'),"Length Wrong"); @@ -149,3 +149,14 @@ sub new { my $class = shift; bless [ @_ ] => $class } package main; ok(decode(latin1 => Encode::Dummy->new("foobar")), "foobar"); ok(encode(utf8 => Encode::Dummy->new("foobar")), "foobar"); + +# hash keys +my $key = (keys %{{ "whatever\x{100}" => '' }})[0]; +my $kopy = $key; +encode("UTF-16LE", $kopy, Encode::FB_CROAK); +ok $key, "whatever\x{100}", 'encode with shared hash key scalars'; +undef $key; +$key = (keys %{{ "whatever" => '' }})[0]; +$kopy = $key; +decode("UTF-16LE", $kopy, Encode::FB_CROAK); +ok $key, "whatever", 'decode with shared hash key scalars'; diff --git a/cpan/Encode/t/Mod_EUCJP.pm b/cpan/Encode/t/Mod_EUCJP.pm index 488f156d5a..ebc401e8e8 100644 --- a/cpan/Encode/t/Mod_EUCJP.pm +++ b/cpan/Encode/t/Mod_EUCJP.pm @@ -1,6 +1,7 @@ -# $Id: Mod_EUCJP.pm,v 2.0 2004/05/16 20:55:17 dankogai Exp $ +# $Id: Mod_EUCJP.pm,v 2.1 2013/02/18 02:23:56 dankogai Exp dankogai $ # This file is in euc-jp package Mod_EUCJP; +no warnings "deprecated"; use encoding "euc-jp"; sub new { my $class = shift; diff --git a/cpan/Encode/t/enc_data.t b/cpan/Encode/t/enc_data.t index 52d7e11996..afca4e590e 100644 --- a/cpan/Encode/t/enc_data.t +++ b/cpan/Encode/t/enc_data.t @@ -1,4 +1,4 @@ -# $Id: enc_data.t,v 2.1 2006/05/03 18:24:10 dankogai Exp $ +# $Id: enc_data.t,v 2.2 2013/02/18 02:23:56 dankogai Exp dankogai $ BEGIN { require Config; import Config; @@ -22,6 +22,7 @@ BEGIN { use strict; +no warnings "deprecated"; use encoding 'euc-jp'; use Test::More tests => 4; diff --git a/cpan/Encode/t/enc_eucjp.t b/cpan/Encode/t/enc_eucjp.t index 2fdd8110d1..dc35c35f6c 100644 --- a/cpan/Encode/t/enc_eucjp.t +++ b/cpan/Encode/t/enc_eucjp.t @@ -1,4 +1,4 @@ -# $Id: enc_eucjp.t,v 2.1 2006/05/03 18:24:10 dankogai Exp $ +# $Id: enc_eucjp.t,v 2.2 2013/02/18 02:23:56 dankogai Exp dankogai $ # This is the twin of enc_utf8.t . BEGIN { @@ -21,6 +21,7 @@ BEGIN { } } +no warnings "deprecated"; use encoding 'euc-jp'; my @c = (127, 128, 255, 256); diff --git a/cpan/Encode/t/enc_module.t b/cpan/Encode/t/enc_module.t index f187bd78b7..0ff3fd1db6 100644 --- a/cpan/Encode/t/enc_module.t +++ b/cpan/Encode/t/enc_module.t @@ -1,4 +1,4 @@ -# $Id: enc_module.t,v 2.1 2006/05/03 18:24:10 dankogai Exp $ +# $Id: enc_module.t,v 2.2 2013/02/18 02:23:56 dankogai Exp dankogai $ # This file is in euc-jp BEGIN { require Config; import Config; @@ -21,6 +21,7 @@ BEGIN { } use lib qw(t ext/Encode/t ../ext/Encode/t); # latter 2 for perl core use Mod_EUCJP; +no warnings "deprecated"; use encoding "euc-jp"; use Test::More tests => 3; use File::Basename; diff --git a/cpan/Encode/t/enc_utf8.t b/cpan/Encode/t/enc_utf8.t index 5a301962cb..de4a4ad6d0 100644 --- a/cpan/Encode/t/enc_utf8.t +++ b/cpan/Encode/t/enc_utf8.t @@ -1,4 +1,4 @@ -# $Id: enc_utf8.t,v 2.1 2006/05/03 18:24:10 dankogai Exp $ +# $Id: enc_utf8.t,v 2.2 2013/02/18 02:23:56 dankogai Exp dankogai $ # This is the twin of enc_eucjp.t . BEGIN { @@ -17,6 +17,7 @@ BEGIN { } } +no warnings "deprecated"; use encoding 'utf8'; my @c = (127, 128, 255, 256); diff --git a/cpan/Encode/t/encoding.t b/cpan/Encode/t/encoding.t index b17b11fc44..8c7f253377 100644 --- a/cpan/Encode/t/encoding.t +++ b/cpan/Encode/t/encoding.t @@ -16,6 +16,7 @@ BEGIN { print "1..31\n"; +no warnings "deprecated"; use encoding "latin1"; # ignored (overwritten by the next line) use encoding "greek"; # iso 8859-7 (no "latin" alias, surprise...) diff --git a/cpan/Encode/t/jperl.t b/cpan/Encode/t/jperl.t index da68468901..915d26c686 100644 --- a/cpan/Encode/t/jperl.t +++ b/cpan/Encode/t/jperl.t @@ -1,5 +1,5 @@ # -# $Id: jperl.t,v 2.1 2006/05/03 18:24:10 dankogai Exp $ +# $Id: jperl.t,v 2.2 2013/02/18 02:23:56 dankogai Exp dankogai $ # # This script is written in euc-jp @@ -27,6 +27,7 @@ use strict; use Test::More tests => 15; # black magic tests commented out my $Debug = shift; +no warnings "deprecated"; no encoding; # ensure my $Enamae = "\xbe\xae\xbb\xf4\x20\xc3\xc6"; # euc-jp, with \x escapes use encoding "euc-jp"; diff --git a/cpan/Encode/t/piconv.t b/cpan/Encode/t/piconv.t index ed084b4159..1dba44a570 100644 --- a/cpan/Encode/t/piconv.t +++ b/cpan/Encode/t/piconv.t @@ -1,5 +1,5 @@ # -# $Id: piconv.t,v 0.3 2009/11/16 14:08:13 dankogai Exp $ +# $Id: piconv.t,v 0.4 2013/02/18 02:23:56 dankogai Exp dankogai $ # BEGIN { @@ -27,8 +27,8 @@ sub run_cmd (;$$); my $blib = File::Spec->rel2abs( - File::Spec->catdir( $FindBin::RealBin, File::Spec->updir, 'blib' ) ); -my $script = File::Spec->catdir($blib, 'script', 'piconv'); + File::Spec->catdir( $FindBin::RealBin, File::Spec->updir ) ); +my $script = File::Spec->catdir($blib, 'bin', 'piconv'); my @base_cmd = ( $^X, "-Mblib=$blib", $script ); plan tests => 5; diff --git a/t/op/concat2.t b/t/op/concat2.t index 66a7d05b83..cc6a5415e8 100644 --- a/t/op/concat2.t +++ b/t/op/concat2.t @@ -15,6 +15,7 @@ plan 3; SKIP: { skip_if_miniperl("no dynamic loading on miniperl, no Encode", 1); +skip('encoding pragma is deprecated', 1) if $] >= 5.017009; fresh_perl_is <<'end', "ok\n", {}, use encoding 'utf8'; map { "a" . $a } ((1)x5000); |