Skip to content

Commit

Permalink
Update Encode to CPAN version 2.48
Browse files Browse the repository at this point in the history
  [DELTA]

  $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.
    dankogai/p5-encode#7
  ! t/piconv.t
    Fix finding piconv in t/piconv.t
    dankogai/p5-encode#6
  • Loading branch information
bingos committed Feb 18, 2013
1 parent f6fe275 commit 64a9a3c
Show file tree
Hide file tree
Showing 20 changed files with 90 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Porting/Maintainers.pl
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ package Maintainers;

'Encode' => {
'MAINTAINER' => 'dankogai',
'DISTRIBUTION' => 'DANKOGAI/Encode-2.47.tar.gz',
'DISTRIBUTION' => 'DANKOGAI/Encode-2.48.tar.gz',
'FILES' => q[cpan/Encode],
'UPSTREAM' => 'cpan',
},
Expand Down
29 changes: 27 additions & 2 deletions cpan/Encode/Changes
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 7 additions & 6 deletions cpan/Encode/Encode.pm
Original file line number Diff line number Diff line change
@@ -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 );
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand All @@ -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 ) {
Expand Down Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion cpan/Encode/Encode/Makefile_PL.e2x
Original file line number Diff line number Diff line change
Expand Up @@ -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!";
Expand Down
4 changes: 2 additions & 2 deletions cpan/Encode/META.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
],
Expand Down Expand Up @@ -35,5 +35,5 @@
}
},
"release_status" : "stable",
"version" : "2.47"
"version" : "2.48"
}
4 changes: 2 additions & 2 deletions cpan/Encode/META.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -18,4 +18,4 @@ no_index:
- t
- inc
requires: {}
version: 2.47
version: 2.48
4 changes: 2 additions & 2 deletions cpan/Encode/Makefile.PL
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -45,7 +45,7 @@ WriteMakefile(
INC => '-I' . File::Spec->catfile( '.', 'Encode' ),
LICENSE => 'perl',
PMLIBDIRS => \@pmlibdirs,
INSTALLDIRS => 'perl',
INSTALLDIRS => ($] < 5.011 ? 'perl' : 'site'),
);

package MY;
Expand Down
12 changes: 11 additions & 1 deletion cpan/Encode/encoding.pm
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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){
Expand Down Expand Up @@ -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?
Expand Down
2 changes: 1 addition & 1 deletion cpan/Encode/lib/Encode/GSM0338.pm
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
4 changes: 2 additions & 2 deletions cpan/Encode/lib/Encode/Supported.pod
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
13 changes: 12 additions & 1 deletion cpan/Encode/t/Encode.t
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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';
3 changes: 2 additions & 1 deletion cpan/Encode/t/Mod_EUCJP.pm
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
3 changes: 2 additions & 1 deletion cpan/Encode/t/enc_data.t
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -22,6 +22,7 @@ BEGIN {


use strict;
no warnings "deprecated";
use encoding 'euc-jp';
use Test::More tests => 4;

Expand Down
3 changes: 2 additions & 1 deletion cpan/Encode/t/enc_eucjp.t
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -21,6 +21,7 @@ BEGIN {
}
}

no warnings "deprecated";
use encoding 'euc-jp';

my @c = (127, 128, 255, 256);
Expand Down
3 changes: 2 additions & 1 deletion cpan/Encode/t/enc_module.t
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion cpan/Encode/t/enc_utf8.t
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -17,6 +17,7 @@ BEGIN {
}
}

no warnings "deprecated";
use encoding 'utf8';

my @c = (127, 128, 255, 256);
Expand Down
1 change: 1 addition & 0 deletions cpan/Encode/t/encoding.t
Original file line number Diff line number Diff line change
Expand Up @@ -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...)

Expand Down
3 changes: 2 additions & 1 deletion cpan/Encode/t/jperl.t
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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";
Expand Down
6 changes: 3 additions & 3 deletions cpan/Encode/t/piconv.t
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions t/op/concat2.t
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 64a9a3c

Please sign in to comment.