cpan/Encode/t/big5-hkscs.enc test data
cpan/Encode/t/big5-hkscs.utf test data
cpan/Encode/t/CJKT.t test script
+cpan/Encode/t/cow.t
+cpan/Encode/t/decode.t
cpan/Encode/t/enc_data.t test script for utf8 DATA
cpan/Encode/t/enc_eucjp.t test script
cpan/Encode/t/enc_module.enc test data for t/enc_module.t
'Encode' => {
'MAINTAINER' => 'dankogai',
- 'DISTRIBUTION' => 'DANKOGAI/Encode-2.52.tar.gz',
+ 'DISTRIBUTION' => 'DANKOGAI/Encode-2.54.tar.gz',
'FILES' => q[cpan/Encode],
'UPSTREAM' => 'cpan',
},
# 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
#
-# $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 );
sub decode_utf8($;$) {
my ( $octets, $check ) = @_;
- return $octets if is_utf8($octets);
return undef unless defined $octets;
$octets .= '' if ref $octets;
$check ||= 0;
/*
- $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
OUTPUT:
RETVAL
+#ifndef SvIsCOW
+# define SvIsCOW (SvREADONLY(sv) && SvFAKE(sv))
+#endif
+
SV *
_utf8_on(sv)
SV * sv
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;
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;
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
"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"
],
}
},
"release_status" : "stable",
- "version" : "2.52"
+ "resources" : {
+ "repository" : {
+ "url" : "https://github.com/dankogai/p5-encode"
+ }
+ },
+ "version" : "2.54"
}
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
- t
- inc
requires: {}
-version: 2.52
+resources:
+ repository: https://github.com/dankogai/p5-encode
+version: 2.54
#
-# $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;
LICENSE => 'perl',
PMLIBDIRS => \@pmlibdirs,
INSTALLDIRS => ($] < 5.011 ? 'perl' : 'site'),
+ META_MERGE => {
+ resources => {
+ repository => 'https://github.com/dankogai/p5-encode',
+ },
+ },
);
package MY;
--- /dev/null
+#
+# $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);
+
--- /dev/null
+#
+# $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) };
+