diff options
author | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2013-12-22 14:40:52 +0000 |
---|---|---|
committer | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2013-12-22 15:05:16 +0000 |
commit | 919ec23b10e41ed5c6aaf77a8ae3d2f7ef279f1b (patch) | |
tree | 62498cd819d0cc48206637adf21789a4fd9090db /cpan | |
parent | c1cec775e9019cc8ae244d4db239a7ea5c0b343e (diff) | |
download | perl-919ec23b10e41ed5c6aaf77a8ae3d2f7ef279f1b.tar.gz |
Update Encode to CPAN version 2.56
[DELTA]
$Revision: 2.55 $ $Date: 2013/09/14 07:51:59 $
! Encode.pm t/Encode.t
Merged RT#91569: [PATCH] decode_utf8 and non-PVs
https://rt.cpan.org/Ticket/Display.html?id=91569
Diffstat (limited to 'cpan')
-rw-r--r-- | cpan/Encode/Encode.pm | 4 | ||||
-rw-r--r-- | cpan/Encode/t/Encode.t | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/cpan/Encode/Encode.pm b/cpan/Encode/Encode.pm index 033bb1569c..81ebb884bd 100644 --- a/cpan/Encode/Encode.pm +++ b/cpan/Encode/Encode.pm @@ -4,7 +4,7 @@ package Encode; use strict; use warnings; -our $VERSION = sprintf "%d.%02d", q$Revision: 2.55 $ =~ /(\d+)/g; +our $VERSION = sprintf "%d.%02d", q$Revision: 2.56 $ =~ /(\d+)/g; use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG}; use XSLoader (); XSLoader::load( __PACKAGE__, $VERSION ); @@ -209,7 +209,7 @@ my $utf8enc; sub decode_utf8($;$) { my ( $octets, $check ) = @_; return undef unless defined $octets; - $octets .= '' if ref $octets; + $octets .= ''; $check ||= 0; $utf8enc ||= find_encoding('utf8'); my $string = $utf8enc->decode( $octets, $check ); diff --git a/cpan/Encode/t/Encode.t b/cpan/Encode/t/Encode.t index 918975eb4c..d4902550b6 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 + 4; +plan test => 38+$n*@encodings + 2*@source*@destiny*@character_set + 2*@ebcdic_sets*256 + 6 + 5; my $str = join('',map(chr($_),0x20..0x7E)); my $cpy = $str; ok(length($str),from_to($cpy,'iso8859-1','Unicode'),"Length Wrong"); @@ -150,6 +150,10 @@ package main; ok(decode(latin1 => Encode::Dummy->new("foobar")), "foobar"); ok(encode(utf8 => Encode::Dummy->new("foobar")), "foobar"); +# RT#91569 +# decode_utf8 with non-string arguments +ok(decode_utf8(*1), "*main::1"); + # hash keys my $key = (keys %{{ "whatever\x{100}" => '' }})[0]; my $kopy = $key; |