From: Jesse Vincent Date: Mon, 16 Nov 2009 15:20:27 +0000 (-0500) Subject: Updated Encode to CPAN release 2.38 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b2deda172989adc48a591cc4a4c1a88918c73105;hp=b65597cb4d6f7ba547ab80880fc66b31b6f08c15;p=p5sagit%2Fp5-mst-13.2.git Updated Encode to CPAN release 2.38 --- diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index e3bf443..e5db2eb 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -521,7 +521,7 @@ use File::Glob qw(:case); 'Encode' => { 'MAINTAINER' => 'dankogai', - 'DISTRIBUTION' => 'DANKOGAI/Encode-2.37.tar.gz', + 'DISTRIBUTION' => 'DANKOGAI/Encode-2.38.tar.gz', 'FILES' => q[cpan/Encode], 'CPAN' => 1, 'UPSTREAM' => undef, diff --git a/cpan/Encode/AUTHORS b/cpan/Encode/AUTHORS index 71e1cc3..a470e57 100644 --- a/cpan/Encode/AUTHORS +++ b/cpan/Encode/AUTHORS @@ -17,14 +17,15 @@ Benjamin Goldberg Bjoern Hoehrmann Bjoern Jacke Chris Nandor -Curtis Jewell Craig A. Berry +Curtis Jewell Dan Kogai Dave Evans Deng Liu Dominic Dunlop Elizabeth Mattijsen Gerrit P. Haase +Gisle Aas Graham Barr Gurusamy Sarathy H.Merijn Brand @@ -59,5 +60,6 @@ Steve Hay Steve Peters Tatsuhiko Miyagawa Tels +Tony Cook Vadim Konovalov Yitzchak Scott-Thoennes diff --git a/cpan/Encode/Byte/Byte.pm b/cpan/Encode/Byte/Byte.pm index 3ea9035..d105aa2 100644 --- a/cpan/Encode/Byte/Byte.pm +++ b/cpan/Encode/Byte/Byte.pm @@ -2,7 +2,7 @@ package Encode::Byte; use strict; use warnings; use Encode; -our $VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; +our $VERSION = do { my @r = ( q$Revision: 2.4 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; use XSLoader; XSLoader::load( __PACKAGE__, $VERSION ); @@ -55,7 +55,7 @@ supported are as follows. viscii # all cp* are also available as ibm-*, ms-*, and windows-* - # also see L + # also see L cp424 cp437 diff --git a/cpan/Encode/CN/CN.pm b/cpan/Encode/CN/CN.pm index 9f120fb..830f345 100644 --- a/cpan/Encode/CN/CN.pm +++ b/cpan/Encode/CN/CN.pm @@ -7,7 +7,7 @@ BEGIN { use strict; use warnings; use Encode; -our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; +our $VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; use XSLoader; XSLoader::load( __PACKAGE__, $VERSION ); @@ -65,11 +65,7 @@ mean C encodings. To fix that, C is aliased to C. Use C when you really mean it. The ASCII region (0x00-0x7f) is preserved for all encodings, even though -this conflicts with mappings by the Unicode Consortium. See - -L - -to find out why it is implemented that way. +this conflicts with mappings by the Unicode Consortium. =head1 SEE ALSO diff --git a/cpan/Encode/Changes b/cpan/Encode/Changes index dcd7384..6c045f7 100644 --- a/cpan/Encode/Changes +++ b/cpan/Encode/Changes @@ -1,12 +1,33 @@ # Revision history for Perl extension Encode. # -# $Id: Changes,v 2.37 2009/09/06 14:32:21 dankogai Exp dankogai $ -$Revision: 2.37 $ $Date: 2009/09/06 14:32:21 $ +# $Id: Changes,v 2.38 2009/11/16 14:08:13 dankogai Exp dankogai $ +$Revision: 2.38 $ $Date: 2009/11/16 14:08:13 $ +! Encode.xs + Addressed: Encode memory corruption [perl #70528] + Message-Id: +! t/Unicode.t Unicode/Unicode.xs + Patched: #51263: set magic is not applied when modifying encode arguments + http://rt.cpan.org/Ticket/Display.html?id=51263 +! Encode.xs + Patched: #51204: Callback CHECK not supported for UTF-8 decoder/encoder + http://rt.cpan.org/Ticket/Display.html?id=51204 +! Byte/Byte.pm CN/CN.pm Changes JP/JP.pm KR/KR.pm TW/TW.pm + Unicode/Unicode.pm bin/enc2xs lib/Encode/Supported.pod + Fix URLs + http://rt.cpan.org/Ticket/Display.html?id=49776 +! t/CJKT.t t/guess.t t/perlio.t t/piconv.t + $PERL_CORE trick is now off for perl 5.11 or better. + Message-Id: + Message-Id: + Message-Id: <20090907154908.GS60303@plum.flirble.org> + Message-Id: <20090907161509.GN8057@iabyn.com> + +2.37 2009/09/06 14:32:21 ! Encode.xs fixed: compilation failure on compilers not supporting C99 http://rt.cpan.org/Ticket/Display.html?id=49466 -2.37 2009/09/06 09:03:07 +2.36 2009/09/06 09:03:07 ! Encode.xs fixed: 'find_encoding("utf8")->decode(undef)' causes segmentation fault http://rt.cpan.org/Ticket/Display.html?id=49462 @@ -518,7 +539,7 @@ $Revision: 2.37 $ $Date: 2009/09/06 14:32:21 $ 1.99 2003/12/29 02:47:16 ! Unicode/Unicode.xs find_encoding("UTF-16BE")->encode("abc") now null terminates - http://www.mail-archive.com/perl5-porters@perl.org/msg69766.html + http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-10/threads.html#00258 ! Encode.pm prototype bug in decode_utf8() fixed Message-Id: <600A4CDA-F004-11D7-B570-000393AE4244@dan.co.jp> diff --git a/cpan/Encode/Encode.pm b/cpan/Encode/Encode.pm index 749c8f9..267642c 100644 --- a/cpan/Encode/Encode.pm +++ b/cpan/Encode/Encode.pm @@ -1,10 +1,10 @@ # -# $Id: Encode.pm,v 2.37 2009/09/06 14:30:32 dankogai Exp $ +# $Id: Encode.pm,v 2.38 2009/11/16 14:08:01 dankogai Exp $ # package Encode; use strict; use warnings; -our $VERSION = sprintf "%d.%02d", q$Revision: 2.37 $ =~ /(\d+)/g; +our $VERSION = sprintf "%d.%02d", q$Revision: 2.38 $ =~ /(\d+)/g; sub DEBUG () { 0 } use XSLoader (); XSLoader::load( __PACKAGE__, $VERSION ); diff --git a/cpan/Encode/Encode.xs b/cpan/Encode/Encode.xs index e5f4c9a..5b8d84c 100644 --- a/cpan/Encode/Encode.xs +++ b/cpan/Encode/Encode.xs @@ -1,5 +1,5 @@ /* - $Id: Encode.xs,v 2.16 2009/09/06 14:32:21 dankogai Exp dankogai $ + $Id: Encode.xs,v 2.17 2009/11/16 14:08:13 dankogai Exp dankogai $ */ #define PERL_NO_GET_CONTEXT @@ -68,7 +68,7 @@ do_fallback_cb(pTHX_ UV ch, SV *fallback_cb) { dSP; int argc; - SV *temp, *retval; + SV *retval = newSVpv("",0); ENTER; SAVETMPS; PUSHMARK(sp); @@ -79,13 +79,10 @@ do_fallback_cb(pTHX_ UV ch, SV *fallback_cb) if (argc != 1){ croak("fallback sub must return scalar!"); } - temp = newSVsv(POPs); + sv_catsv(retval, POPs); PUTBACK; FREETMPS; LEAVE; - retval = newSVpv("",0); - sv_catsv(retval, temp); - SvREFCNT_dec(temp); return retval; } @@ -199,6 +196,7 @@ encode_method(pTHX_ const encode_t * enc, const encpage_t * dir, SV * src, : newSVpvf(check & ENCODE_PERLQQ ? "\\x{%04"UVxf"}" : check & ENCODE_HTMLCREF ? "&#%" UVuf ";" : "&#x%" UVxf ";", (UV)ch); + SvUTF8_off(subchar); /* make sure no decoded string gets in */ sdone += slen + clen; ddone += dlen + SvCUR(subchar); sv_catsv(dst, subchar); @@ -401,19 +399,26 @@ MODULE = Encode PACKAGE = Encode::utf8 PREFIX = Method_ PROTOTYPES: DISABLE void -Method_decode_xs(obj,src,check = 0) +Method_decode_xs(obj,src,check_sv = &PL_sv_no) SV * obj SV * src -int check +SV * check_sv PREINIT: STRLEN slen; U8 *s; U8 *e; SV *dst; bool renewed = 0; + int check; CODE: { dSP; ENTER; SAVETMPS; + if (SvROK(check_sv)) { + croak("UTF-8 decoder doesn't support callback CHECK"); + } + else { + check = SvIV(check_sv); + } if (src == &PL_sv_undef) src = newSV(0); s = (U8 *) SvPV(src, slen); e = (U8 *) SvEND(src); @@ -464,18 +469,25 @@ CODE: } void -Method_encode_xs(obj,src,check = 0) +Method_encode_xs(obj,src,check_sv = &PL_sv_no) SV * obj SV * src -int check +SV * check_sv PREINIT: STRLEN slen; U8 *s; U8 *e; SV *dst; bool renewed = 0; + int check; CODE: { + if (SvROK(check_sv)) { + croak("UTF-8 encoder doesn't support callback CHECK"); + } + else { + check = SvIV(check_sv); + } if (src == &PL_sv_undef) src = newSV(0); s = (U8 *) SvPV(src, slen); e = (U8 *) SvEND(src); diff --git a/cpan/Encode/JP/JP.pm b/cpan/Encode/JP/JP.pm index e78e54d..4251170 100644 --- a/cpan/Encode/JP/JP.pm +++ b/cpan/Encode/JP/JP.pm @@ -7,7 +7,7 @@ BEGIN { use strict; use warnings; use Encode; -our $VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; +our $VERSION = do { my @r = ( q$Revision: 2.4 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; use XSLoader; XSLoader::load( __PACKAGE__, $VERSION ); @@ -86,11 +86,7 @@ in order to preserve text layout as much as possible. =head1 BUGS The ASCII region (0x00-0x7f) is preserved for all encodings, even -though this conflicts with mappings by the Unicode Consortium. See - -L - -to find out why it is implemented that way. +though this conflicts with mappings by the Unicode Consortium. =head1 SEE ALSO diff --git a/cpan/Encode/KR/KR.pm b/cpan/Encode/KR/KR.pm index 8cb2c63..cf2c117 100644 --- a/cpan/Encode/KR/KR.pm +++ b/cpan/Encode/KR/KR.pm @@ -7,7 +7,7 @@ BEGIN { use strict; use warnings; use Encode; -our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; +our $VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; use XSLoader; XSLoader::load( __PACKAGE__, $VERSION ); @@ -60,11 +60,7 @@ mean "cp949" encodings. To fix that, the following aliases are set; qr/ks_c_5601-1987$/i => '"cp949"' The ASCII region (0x00-0x7f) is preserved for all encodings, even -though this conflicts with mappings by the Unicode Consortium. See - -L - -to find out why it is implemented that way. +though this conflicts with mappings by the Unicode Consortium. =head1 SEE ALSO diff --git a/cpan/Encode/META.yml b/cpan/Encode/META.yml index 85a3cd0..70090af 100644 --- a/cpan/Encode/META.yml +++ b/cpan/Encode/META.yml @@ -1,6 +1,6 @@ --- #YAML:1.0 name: Encode -version: 2.37 +version: 2.38 abstract: ~ author: [] license: unknown @@ -14,7 +14,7 @@ no_index: directory: - t - inc -generated_by: ExtUtils::MakeMaker version 6.54 +generated_by: ExtUtils::MakeMaker version 6.55_02 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 diff --git a/cpan/Encode/TW/TW.pm b/cpan/Encode/TW/TW.pm index ffaa844..c30499b 100644 --- a/cpan/Encode/TW/TW.pm +++ b/cpan/Encode/TW/TW.pm @@ -7,7 +7,7 @@ BEGIN { use strict; use warnings; use Encode; -our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; +our $VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; use XSLoader; XSLoader::load( __PACKAGE__, $VERSION ); @@ -66,11 +66,7 @@ manipulation, please use C in L, which contains planes 1-7. The ASCII region (0x00-0x7f) is preserved for all encodings, even -though this conflicts with mappings by the Unicode Consortium. See - -L - -to find out why it is implemented that way. +though this conflicts with mappings by the Unicode Consortium. =head1 SEE ALSO diff --git a/cpan/Encode/Unicode/Unicode.pm b/cpan/Encode/Unicode/Unicode.pm index 16982bb..f71567c 100644 --- a/cpan/Encode/Unicode/Unicode.pm +++ b/cpan/Encode/Unicode/Unicode.pm @@ -4,7 +4,7 @@ use strict; use warnings; no warnings 'redefine'; -our $VERSION = do { my @r = ( q$Revision: 2.6 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; +our $VERSION = do { my @r = ( q$Revision: 2.7 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; use XSLoader; XSLoader::load( __PACKAGE__, $VERSION ); @@ -259,7 +259,7 @@ Consider that "division by zero" of Encode :) L, L, L, L, -RFC 2781 L, +RFC 2781 L, The whole Unicode standard L diff --git a/cpan/Encode/Unicode/Unicode.xs b/cpan/Encode/Unicode/Unicode.xs index 1f041d4..d8ef569 100644 --- a/cpan/Encode/Unicode/Unicode.xs +++ b/cpan/Encode/Unicode/Unicode.xs @@ -1,5 +1,5 @@ /* - $Id: Unicode.xs,v 2.5 2009/02/01 13:14:41 dankogai Exp $ + $Id: Unicode.xs,v 2.6 2009/11/16 14:08:13 dankogai Exp dankogai $ */ #define PERL_NO_GET_CONTEXT @@ -377,5 +377,7 @@ CODE: if (!temp_result) shrink_buffer(result); + SvSETMAGIC(utf8); + XSRETURN(1); } diff --git a/cpan/Encode/bin/enc2xs b/cpan/Encode/bin/enc2xs old mode 100644 new mode 100755 index 233ca54..773c0a0 --- 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.6 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +our $VERSION = do { my @r = (q$Revision: 2.7 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; # These may get re-ordered. # RAW is a do_now as inserted by &enter @@ -1356,7 +1356,7 @@ L =item * ICU Character Mapping Tables -L +L =item * diff --git a/cpan/Encode/bin/piconv b/cpan/Encode/bin/piconv old mode 100644 new mode 100755 diff --git a/cpan/Encode/bin/ucm2table b/cpan/Encode/bin/ucm2table old mode 100644 new mode 100755 diff --git a/cpan/Encode/bin/ucmsort b/cpan/Encode/bin/ucmsort old mode 100644 new mode 100755 diff --git a/cpan/Encode/bin/unidump b/cpan/Encode/bin/unidump old mode 100644 new mode 100755 diff --git a/cpan/Encode/lib/Encode/Supported.pod b/cpan/Encode/lib/Encode/Supported.pod index 431bb77..e84faaf 100644 --- a/cpan/Encode/lib/Encode/Supported.pod +++ b/cpan/Encode/lib/Encode/Supported.pod @@ -589,7 +589,7 @@ for example) it is beyond the power of words to describe the way HTML browsers encode non-C form data. To get a general impression, visit -L. +L. While encoding of form data has stabilized for C encoded pages (at least IE 5/6, NS 6, and Opera 6 behave consistently), be sure to expect fun (and cross-browser discrepancies) with C encoded @@ -817,7 +817,7 @@ L =item RFC Request For Comments -- need I say more? -L, L, +L, L, L =item UC @@ -850,7 +850,7 @@ vs. vendor mappings. =item CJK.inf -L +L Somewhat obsolete (last update in 1996), but still useful. Also try @@ -893,7 +893,7 @@ to better support CJKV languages/scripts in all the areas of information processing. To purchase this book, visit -L +L or your favourite bookstore. =back diff --git a/cpan/Encode/t/CJKT.t b/cpan/Encode/t/CJKT.t index 1648b1e..8866f75 100644 --- a/cpan/Encode/t/CJKT.t +++ b/cpan/Encode/t/CJKT.t @@ -1,4 +1,8 @@ BEGIN { + if ( $ENV{'PERL_CORE'} && $] >= 5.011) { + chdir 't'; + unshift @INC, '../lib'; + } require Config; import Config; if ($Config{'extensions'} !~ /\bEncode\b/) { print "1..0 # Skip: Encode was not built\n"; diff --git a/cpan/Encode/t/Unicode.t b/cpan/Encode/t/Unicode.t index aa80899..d6dd1ec 100644 --- a/cpan/Encode/t/Unicode.t +++ b/cpan/Encode/t/Unicode.t @@ -1,5 +1,5 @@ # -# $Id: Unicode.t,v 2.1 2006/05/03 18:24:10 dankogai Exp $ +# $Id: Unicode.t,v 2.2 2009/11/16 14:08:13 dankogai Exp dankogai $ # # This script is written entirely in ASCII, even though quoted literals # do include non-BMP unicode characters -- Are you happy, jhi? @@ -20,8 +20,8 @@ BEGIN { use strict; #use Test::More 'no_plan'; -use Test::More tests => 37; -use Encode qw(encode decode); +use Test::More tests => 38; +use Encode qw(encode decode find_encoding); # # see @@ -131,5 +131,35 @@ for my $file (@file){ is(decode("UTF-7", encode("UTF-7", $content)), $content, "UTF-7 RT:$file"); } + +# Magic +{ + # see http://rt.perl.org/rt3//Ticket/Display.html?id=60472 + my $work = chr(0x100); + my $encoding = find_encoding("UTF16-BE"); + my $tied; + tie $tied, SomeScalar => \$work; + my $result = $encoding->encode($tied, 1); + is($work, "", "check set magic was applied"); +} + +package SomeScalar; +use Tie::Scalar; +use vars qw(@ISA); +BEGIN { @ISA = 'Tie::Scalar' } + +sub TIESCALAR { + my ($class, $ref) = @_; + return bless $ref, $class; +} + +sub FETCH { + ${$_[0]} +} + +sub STORE { + ${$_[0]} = $_[1]; +} + 1; __END__ diff --git a/cpan/Encode/t/guess.t b/cpan/Encode/t/guess.t index 37ddd5a..514ecac 100644 --- a/cpan/Encode/t/guess.t +++ b/cpan/Encode/t/guess.t @@ -1,4 +1,8 @@ BEGIN { + if ( $ENV{'PERL_CORE'} && $] >= 5.011) { + chdir 't'; + unshift @INC, '../lib'; + } require Config; import Config; if ($Config{'extensions'} !~ /\bEncode\b/) { print "1..0 # Skip: Encode was not built\n"; diff --git a/cpan/Encode/t/perlio.t b/cpan/Encode/t/perlio.t index e50dfa4..2dee60d 100644 --- a/cpan/Encode/t/perlio.t +++ b/cpan/Encode/t/perlio.t @@ -1,4 +1,8 @@ BEGIN { + if ( $ENV{'PERL_CORE'} && $] >= 5.011) { + chdir 't'; + unshift @INC, '../lib'; + } require Config; import Config; if ($Config{'extensions'} !~ /\bEncode\b/) { print "1..0 # Skip: Encode was not built\n"; diff --git a/cpan/Encode/t/piconv.t b/cpan/Encode/t/piconv.t index b24d753..ee8a814 100644 --- a/cpan/Encode/t/piconv.t +++ b/cpan/Encode/t/piconv.t @@ -1,20 +1,26 @@ # -# $Id: piconv.t,v 0.2 2009/07/13 00:50:52 dankogai Exp $ +# $Id: piconv.t,v 0.3 2009/11/16 14:08:13 dankogai Exp dankogai $ # +BEGIN { + if ( $ENV{'PERL_CORE'} && $] >= 5.011) { + print "1..0 # Skip: Don't know how to test this within perl's core\n"; + exit 0; + } +} + use strict; -use Config; use FindBin; use File::Spec; use IPC::Open3 qw(open3); use IO::Select; use Test::More; -my $nofork = ! $Config{d_fork}; +my $WIN = $^O eq 'MSWin32'; -if ($nofork) { +if ($WIN) { eval { require IPC::Run; IPC::Run->VERSION(0.83); 1; } or - plan skip_all => 'Without fork(), we require IPC::Run 0.83 to complete this test'; + plan skip_all => 'Win32 environments require IPC::Run 0.83 to complete this test'; } sub run_cmd (;$$); @@ -23,14 +29,14 @@ my $blib = File::Spec->rel2abs( File::Spec->catdir( $FindBin::RealBin, File::Spec->updir, 'blib' ) ); my $script = File::Spec->catdir($blib, 'script', 'piconv'); -my @base_cmd = ( $^X, ($ENV{PERL_CORE} ? () : "-Mblib=$blib"), $script ); +my @base_cmd = ( $^X, "-Mblib=$blib", $script ); plan tests => 5; { my ( $st, $out, $err ) = run_cmd; is( $st, 0, 'status for usage call' ); - is( $out, $nofork ? undef : '' ); + is( $out, $WIN ? undef : '' ); like( $err, qr{^piconv}, 'usage' ); } @@ -52,7 +58,7 @@ sub run_cmd (;$$) { my $err = "x" x 10_000; $err = ""; - if ($nofork) { + if ($WIN) { IPC::Run->import(qw(run timeout)); my @cmd; if (defined $args) {