summaryrefslogtreecommitdiff
path: root/cpan
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2015-01-22 13:33:18 +0000
committerSteve Hay <steve.m.hay@googlemail.com>2015-01-23 08:19:29 +0000
commit127a7155e792d480c35e856b70f4e4378fc91f49 (patch)
tree478286017ffdda4de4f887cdb57ffbb83ee102c5 /cpan
parent7131132e2e682f1f0465c6226ed180c2061b97aa (diff)
downloadperl-127a7155e792d480c35e856b70f4e4378fc91f49.tar.gz
Upgrade Encode from version 2.67 to 2.68
Diffstat (limited to 'cpan')
-rw-r--r--cpan/Encode/Encode.pm12
-rw-r--r--cpan/Encode/Encode.xs4
-rw-r--r--cpan/Encode/bin/enc2xs27
-rw-r--r--cpan/Encode/lib/Encode/MIME/Header.pm4
-rw-r--r--cpan/Encode/t/taint.t5
5 files changed, 31 insertions, 21 deletions
diff --git a/cpan/Encode/Encode.pm b/cpan/Encode/Encode.pm
index eec1485d9c..c34e997d04 100644
--- a/cpan/Encode/Encode.pm
+++ b/cpan/Encode/Encode.pm
@@ -1,10 +1,10 @@
#
-# $Id: Encode.pm,v 2.67 2014/12/04 20:12:29 dankogai Exp $
+# $Id: Encode.pm,v 2.68 2015/01/22 10:17:32 dankogai Exp dankogai $
#
package Encode;
use strict;
use warnings;
-our $VERSION = sprintf "%d.%02d", q$Revision: 2.67 $ =~ /(\d+)/g;
+our $VERSION = sprintf "%d.%02d", q$Revision: 2.68 $ =~ /(\d+)/g;
use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG};
use XSLoader ();
XSLoader::load( __PACKAGE__, $VERSION );
@@ -483,7 +483,7 @@ If the $string is C<undef>, then C<undef> is returned.
This function returns the string that results from decoding the scalar
value I<OCTETS>, assumed to be a sequence of octets in I<ENCODING>, into
-Perl's internal form. The returns the resulting string. As with encode(),
+Perl's internal form. As with encode(),
I<ENCODING> can be either a canonical name or an alias. For encoding names
and aliases, see L</"Defining Aliases">; for I<CHECK>, see L</"Handling
Malformed Data">.
@@ -573,7 +573,7 @@ Also note that:
from_to($octets, $from, $to, $check);
-is equivalent t:o
+is equivalent to:
$octets = encode($to, decode($from, $octets), $check);
@@ -700,7 +700,7 @@ In the first version above, you let the appropriate encoding layer
handle the conversion. In the second, you explicitly translate
from one encoding to the other.
-Unfortunately, it may be that encodings are C<PerlIO>-savvy. You can check
+Unfortunately, it may be that encodings are not C<PerlIO>-savvy. You can check
to see whether your encoding is supported by C<PerlIO> by invoking the
C<perlio_ok> method on it:
@@ -836,7 +836,7 @@ Acts like C<FB_PERLQQ> but U+I<XXXX> is used instead of C<\x{I<XXXX>}>.
Even the fallback for C<decode> must return octets, which are
then decoded with the character encoding that C<decode> accepts. So for
-example if you wish to decode octests as UTF-8, and use ISO-8859-15 as
+example if you wish to decode octets as UTF-8, and use ISO-8859-15 as
a fallback for bytes that are not valid UTF-8, you could write
$str = decode 'UTF-8', $octets, sub {
diff --git a/cpan/Encode/Encode.xs b/cpan/Encode/Encode.xs
index 0f12a7cf38..7ec8d44752 100644
--- a/cpan/Encode/Encode.xs
+++ b/cpan/Encode/Encode.xs
@@ -1,5 +1,5 @@
/*
- $Id: Encode.xs,v 2.32 2014/11/27 14:08:33 dankogai Exp $
+ $Id: Encode.xs,v 2.33 2015/01/22 10:17:32 dankogai Exp dankogai $
*/
#define PERL_NO_GET_CONTEXT
@@ -7,6 +7,7 @@
#include "perl.h"
#include "XSUB.h"
#include "encode.h"
+#include "def_t.h"
# define PERLIO_MODNAME "PerlIO::encoding"
# define PERLIO_FILENAME "PerlIO/encoding.pm"
@@ -1002,6 +1003,5 @@ OUTPUT:
BOOT:
{
-#include "def_t.h"
#include "def_t.exh"
}
diff --git a/cpan/Encode/bin/enc2xs b/cpan/Encode/bin/enc2xs
index 276a204ce3..19f2b2b33f 100644
--- a/cpan/Encode/bin/enc2xs
+++ b/cpan/Encode/bin/enc2xs
@@ -10,7 +10,7 @@ use warnings;
use Getopt::Std;
use Config;
my @orig_ARGV = @ARGV;
-our $VERSION = do { my @r = (q$Revision: 2.16 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 2.17 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
# These may get re-ordered.
# RAW is a do_now as inserted by &enter
@@ -133,10 +133,18 @@ my %opt;
# -o <output> to specify the output file name (else it's the first arg)
# -f <inlist> to give a file with a list of input files (else use the args)
# -n <name> to name the encoding (else use the basename of the input file.
-getopts('CM:SQqOo:f:n:',\%opt);
+getopts('CM:SQqOo:f:n:v',\%opt);
$opt{M} and make_makefile_pl($opt{M}, @ARGV);
$opt{C} and make_configlocal_pm($opt{C}, @ARGV);
+$opt{v} ||= $ENV{ENC2XS_VERBOSE};
+
+sub verbose {
+ print STDERR @_ if $opt{v};
+}
+sub verbosef {
+ printf STDERR @_ if $opt{v};
+}
# This really should go first, else the die here causes empty (non-erroneous)
# output files to be written.
@@ -252,7 +260,7 @@ foreach my $enc (sort cmp_name @encfiles)
if ($doC)
{
- print STDERR "Writing compiled form\n";
+ verbose "Writing compiled form\n";
foreach my $name (sort cmp_name keys %encoding)
{
my ($e2u,$u2e,$erep,$min_el,$max_el) = @{$encoding{$name}};
@@ -272,8 +280,9 @@ if ($doC)
# push(@{$encoding{$name}},outstring(\*C,$e2u->{Cname}.'_def',$erep));
}
my $cpp = ($Config{d_cplusplus} || '') eq 'define';
- my $exta = $cpp ? 'extern "C" ' : "static";
- my $extb = $cpp ? 'extern "C" ' : "";
+ my $ext = $cpp ? 'extern "C"' : "extern";
+ my $exta = $cpp ? 'extern "C"' : "static";
+ my $extb = $cpp ? 'extern "C"' : "";
foreach my $enc (sort cmp_name keys %encoding)
{
# my ($e2u,$u2e,$rep,$min_el,$max_el,$rsym) = @{$encoding{$enc}};
@@ -300,7 +309,7 @@ if ($doC)
{
my $sym = "${enc}_encoding";
$sym =~ s/\W+/_/g;
- print H "extern encode_t $sym;\n";
+ print H "${ext} encode_t $sym;\n";
print D " Encode_XSEncoding(aTHX_ &$sym);\n";
}
@@ -347,10 +356,10 @@ END
my $perc_saved = $saved/($strings + $saved) * 100;
my $perc_subsaved = $subsave/($strings + $subsave) * 100;
- printf STDERR "%d bytes in string tables\n",$strings;
- printf STDERR "%d bytes (%.3g%%) saved spotting duplicates\n",
+ verbosef "%d bytes in string tables\n",$strings;
+ verbosef "%d bytes (%.3g%%) saved spotting duplicates\n",
$saved, $perc_saved if $saved;
- printf STDERR "%d bytes (%.3g%%) saved using substrings\n",
+ verbosef "%d bytes (%.3g%%) saved using substrings\n",
$subsave, $perc_subsaved if $subsave;
}
elsif ($doEnc)
diff --git a/cpan/Encode/lib/Encode/MIME/Header.pm b/cpan/Encode/lib/Encode/MIME/Header.pm
index 090a177d11..b970b62577 100644
--- a/cpan/Encode/lib/Encode/MIME/Header.pm
+++ b/cpan/Encode/lib/Encode/MIME/Header.pm
@@ -3,7 +3,7 @@ use strict;
use warnings;
no warnings 'redefine';
-our $VERSION = do { my @r = ( q$Revision: 2.15 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.16 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use Encode qw(find_encoding encode_utf8 decode_utf8);
use MIME::Base64;
use Carp;
@@ -139,7 +139,7 @@ sub encode($$;$) {
push @line, join( "\n " => @subline );
}
$_[1] = '' if $chk;
- return join( "\n", @line );
+ return (substr($str, 0, 0) . join( "\n", @line ));
}
use constant HEAD => '=?UTF-8?';
diff --git a/cpan/Encode/t/taint.t b/cpan/Encode/t/taint.t
index 1ad033b676..2446dd76d3 100644
--- a/cpan/Encode/t/taint.t
+++ b/cpan/Encode/t/taint.t
@@ -3,7 +3,8 @@ use strict;
use Encode qw(encode decode);
use Scalar::Util qw(tainted);
use Test::More;
-my $str = "dan\x{5f3e}" . substr($ENV{PATH},0,0); # tainted string to encode
+my $taint = substr($ENV{PATH},0,0);
+my $str = "dan\x{5f3e}" . $taint; # tainted string to encode
my $bin = encode('UTF-8', $str); # tainted binary to decode
my @names = Encode->encodings(':all');
plan tests => 2 * @names;
@@ -16,7 +17,7 @@ for my $name (@names) {
skip $@, 1 if $@;
ok tainted($e), "encode $name";
}
- $bin = $e if $e;
+ $bin = $e.$taint if $e;
eval {
$d = decode($name, $bin);
};