summaryrefslogtreecommitdiff
path: root/cpan
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2013-08-29 19:30:07 +0100
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2013-08-29 19:30:07 +0100
commitb9f6c3703594b2b2c85baba16e93c978e2ee323f (patch)
treed6c769f92ed2632150beeacc24098be057a6da6c /cpan
parentc0bf20e0fac5d13bbb363601f748e7a3c1072d6c (diff)
downloadperl-b9f6c3703594b2b2c85baba16e93c978e2ee323f.tar.gz
Update Encode to CPAN version 2.54
[DELTA] $Revision: 2.54 $ $Date: 2013/08/29 16:47:39 $ ! Encode.xs + t/cow.t Addressed: COW breakage with _utf8_on() https://rt.cpan.org/Ticket/Display.html?id=88230 ! Encode.pm Reverted the document accordingly to #11 https://github.com/dankogai/p5-encode/pull/10 + t/decode.t Unit test for decoding behavior change in #11 https://github.com/dankogai/p5-encode/pull/12 2.53 2013/08/29 15:20:31 ! Encode.pm Merged: Do not short-circuit decode_utf8 with utf8 flags https://github.com/dankogai/p5-encode/pull/11 Merged: document decode_utf8 behaviour more precise https://github.com/dankogai/p5-encode/pull/10 ! Makefile.PL Added repository cpan metadata https://github.com/dankogai/p5-encode/pull/9
Diffstat (limited to 'cpan')
-rw-r--r--cpan/Encode/Changes26
-rw-r--r--cpan/Encode/Encode.pm5
-rw-r--r--cpan/Encode/Encode.xs8
-rw-r--r--cpan/Encode/MANIFEST2
-rw-r--r--cpan/Encode/META.json9
-rw-r--r--cpan/Encode/META.yml6
-rw-r--r--cpan/Encode/Makefile.PL7
-rw-r--r--cpan/Encode/t/cow.t20
-rw-r--r--cpan/Encode/t/decode.t25
9 files changed, 97 insertions, 11 deletions
diff --git a/cpan/Encode/Changes b/cpan/Encode/Changes
index 3e6b9b037c..c3d722964c 100644
--- a/cpan/Encode/Changes
+++ b/cpan/Encode/Changes
@@ -1,8 +1,30 @@
# Revision history for Perl extension Encode.
#
-# $Id: Changes,v 2.52 2013/08/14 02:29:54 dankogai Exp $
+# $Id: Changes,v 2.54 2013/08/29 16:47:39 dankogai Exp dankogai $
#
-$Revision: 2.52 $ $Date: 2013/08/14 02:29:54 $
+$Revision: 2.54 $ $Date: 2013/08/29 16:47:39 $
+! Encode.xs
++ t/cow.t
+ Addressed: COW breakage with _utf8_on()
+ https://rt.cpan.org/Ticket/Display.html?id=88230
+! Encode.pm
+ Reverted the document accordingly to #11
+ https://github.com/dankogai/p5-encode/pull/10
++ t/decode.t
+ Unit test for decoding behavior change in #11
+ https://github.com/dankogai/p5-encode/pull/12
+
+2.53 2013/08/29 15:20:31
+! Encode.pm
+ Merged: Do not short-circuit decode_utf8 with utf8 flags
+ https://github.com/dankogai/p5-encode/pull/11
+ Merged: document decode_utf8 behaviour more precise
+ https://github.com/dankogai/p5-encode/pull/10
+! Makefile.PL
+ Added repository cpan metadata
+ https://github.com/dankogai/p5-encode/pull/9
+
+2.52 2013/08/14 02:29:54
! ucm/*.ucm
Addressed:
Unicode Mappping tables are missing Unicode Inc. license notification
diff --git a/cpan/Encode/Encode.pm b/cpan/Encode/Encode.pm
index aea404a030..4285871c6c 100644
--- a/cpan/Encode/Encode.pm
+++ b/cpan/Encode/Encode.pm
@@ -1,10 +1,10 @@
#
-# $Id: Encode.pm,v 2.52 2013/08/14 02:29:54 dankogai Exp $
+# $Id: Encode.pm,v 2.54 2013/08/29 16:47:39 dankogai Exp dankogai $
#
package Encode;
use strict;
use warnings;
-our $VERSION = sprintf "%d.%02d", q$Revision: 2.52 $ =~ /(\d+)/g;
+our $VERSION = sprintf "%d.%02d", q$Revision: 2.54 $ =~ /(\d+)/g;
use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG};
use XSLoader ();
XSLoader::load( __PACKAGE__, $VERSION );
@@ -209,7 +209,6 @@ my $utf8enc;
sub decode_utf8($;$) {
my ( $octets, $check ) = @_;
- return $octets if is_utf8($octets);
return undef unless defined $octets;
$octets .= '' if ref $octets;
$check ||= 0;
diff --git a/cpan/Encode/Encode.xs b/cpan/Encode/Encode.xs
index d088d25083..3ecfdada1e 100644
--- a/cpan/Encode/Encode.xs
+++ b/cpan/Encode/Encode.xs
@@ -1,5 +1,5 @@
/*
- $Id: Encode.xs,v 2.23 2013/04/29 22:19:11 dankogai Exp $
+ $Id: Encode.xs,v 2.24 2013/08/29 16:47:39 dankogai Exp dankogai $
*/
#define PERL_NO_GET_CONTEXT
@@ -837,6 +837,10 @@ CODE:
OUTPUT:
RETVAL
+#ifndef SvIsCOW
+# define SvIsCOW (SvREADONLY(sv) && SvFAKE(sv))
+#endif
+
SV *
_utf8_on(sv)
SV * sv
@@ -845,6 +849,7 @@ CODE:
if (SvPOK(sv)) {
SV *rsv = newSViv(SvUTF8(sv));
RETVAL = rsv;
+ if (SvIsCOW(sv)) sv_force_normal(sv);
SvUTF8_on(sv);
} else {
RETVAL = &PL_sv_undef;
@@ -861,6 +866,7 @@ CODE:
if (SvPOK(sv)) {
SV *rsv = newSViv(SvUTF8(sv));
RETVAL = rsv;
+ if (SvIsCOW(sv)) sv_force_normal(sv);
SvUTF8_off(sv);
} else {
RETVAL = &PL_sv_undef;
diff --git a/cpan/Encode/MANIFEST b/cpan/Encode/MANIFEST
index be51afdcd3..5fb6115fc8 100644
--- a/cpan/Encode/MANIFEST
+++ b/cpan/Encode/MANIFEST
@@ -67,6 +67,8 @@ t/big5-eten.enc test data
t/big5-eten.utf test data
t/big5-hkscs.enc test data
t/big5-hkscs.utf test data
+t/cow.t test script
+t/decode.t test script
t/enc_data.t test script for encoding.pm vs. DATA fh
t/enc_eucjp.t test script
t/enc_module.enc test data for t/enc_module.t
diff --git a/cpan/Encode/META.json b/cpan/Encode/META.json
index 4f3b6d8ffd..b50c27364a 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.68, CPAN::Meta::Converter version 2.131560",
+ "generated_by" : "ExtUtils::MakeMaker version 6.72, CPAN::Meta::Converter version 2.132140",
"license" : [
"perl_5"
],
@@ -35,5 +35,10 @@
}
},
"release_status" : "stable",
- "version" : "2.52"
+ "resources" : {
+ "repository" : {
+ "url" : "https://github.com/dankogai/p5-encode"
+ }
+ },
+ "version" : "2.54"
}
diff --git a/cpan/Encode/META.yml b/cpan/Encode/META.yml
index f2a8256f57..5bb345a23b 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.68, CPAN::Meta::Converter version 2.131560'
+generated_by: 'ExtUtils::MakeMaker version 6.72, CPAN::Meta::Converter version 2.132140'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -18,4 +18,6 @@ no_index:
- t
- inc
requires: {}
-version: 2.52
+resources:
+ repository: https://github.com/dankogai/p5-encode
+version: 2.54
diff --git a/cpan/Encode/Makefile.PL b/cpan/Encode/Makefile.PL
index 126f00e515..6cc1b4fd38 100644
--- a/cpan/Encode/Makefile.PL
+++ b/cpan/Encode/Makefile.PL
@@ -1,5 +1,5 @@
#
-# $Id: Makefile.PL,v 2.10 2013/02/18 02:23:56 dankogai Exp $
+# $Id: Makefile.PL,v 2.11 2013/08/29 15:20:31 dankogai Exp $
#
use 5.007003;
use strict;
@@ -46,6 +46,11 @@ WriteMakefile(
LICENSE => 'perl',
PMLIBDIRS => \@pmlibdirs,
INSTALLDIRS => ($] < 5.011 ? 'perl' : 'site'),
+ META_MERGE => {
+ resources => {
+ repository => 'https://github.com/dankogai/p5-encode',
+ },
+ },
);
package MY;
diff --git a/cpan/Encode/t/cow.t b/cpan/Encode/t/cow.t
new file mode 100644
index 0000000000..2b8cec66f0
--- /dev/null
+++ b/cpan/Encode/t/cow.t
@@ -0,0 +1,20 @@
+#
+# $Id: cow.t,v 1.1 2013/08/29 16:47:39 dankogai Exp dankogai $
+#
+use strict;
+use Encode ();
+use Test::More tests => 2;
+
+
+my %a = ( "L\x{c3}\x{a9}on" => "acme" );
+my ($k) = ( keys %a );
+Encode::_utf8_on($k);
+my %h = ( $k => "acme" );
+is $h{"L\x{e9}on"} => 'acme';
+($k) = ( keys %h );
+Encode::_utf8_off($k);
+%a = ( $k => "acme" );
+is $h{"L\x{e9}on"} => 'acme';
+# use Devel::Peek;
+# Dump(\%h);
+
diff --git a/cpan/Encode/t/decode.t b/cpan/Encode/t/decode.t
new file mode 100644
index 0000000000..8281ca8f21
--- /dev/null
+++ b/cpan/Encode/t/decode.t
@@ -0,0 +1,25 @@
+#
+# $Id: decode.t,v 1.1 2013/08/29 16:47:39 dankogai Exp dankogai $
+#
+use strict;
+use Encode qw(decode_utf8 FB_CROAK);
+use Test::More tests => 3;
+
+sub croak_ok(&) {
+ my $code = shift;
+ eval { $code->() };
+ like $@, qr/does not map/;
+}
+
+my $bytes = "L\x{e9}on";
+my $pad = "\x{30C9}";
+
+my $orig = $bytes;
+croak_ok { Encode::decode_utf8($orig, FB_CROAK) };
+
+my $orig2 = $bytes;
+croak_ok { Encode::decode('utf-8', $orig2, FB_CROAK) };
+
+chop(my $new = $bytes . $pad);
+croak_ok { Encode::decode_utf8($new, FB_CROAK) };
+