summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2009-07-13 09:40:04 +0200
committerDavid Mitchell <davem@iabyn.com>2009-07-13 15:27:55 +0100
commitc596faae72b49705a1b1ef610e725fc7eebf0768 (patch)
treec114e4f7efd0a89f69bce0802e841148ea5c8da9 /ext
parenteb024bdafe021e7d04d3d658a06752c45b21b8f5 (diff)
downloadperl-c596faae72b49705a1b1ef610e725fc7eebf0768.tar.gz
Upgrade to Encode 2.35
(cherry picked from commit 03c97657d956dea96e5d0f6153cf59094a55c6b1)
Diffstat (limited to 'ext')
-rw-r--r--ext/Encode/AUTHORS1
-rw-r--r--ext/Encode/Changes14
-rw-r--r--ext/Encode/Encode.pm4
-rw-r--r--ext/Encode/lib/Encode/MIME/Header.pm4
-rw-r--r--ext/Encode/t/piconv.t84
5 files changed, 72 insertions, 35 deletions
diff --git a/ext/Encode/AUTHORS b/ext/Encode/AUTHORS
index c928a3200c..71e1cc3c7a 100644
--- a/ext/Encode/AUTHORS
+++ b/ext/Encode/AUTHORS
@@ -17,6 +17,7 @@ Benjamin Goldberg <goldbb2@earthlink.net>
Bjoern Hoehrmann <derhoermi@gmx.net>
Bjoern Jacke <debianbugs@j3e.de>
Chris Nandor <pudge@pobox.com>
+Curtis Jewell <csjewell@cpan.org>
Craig A. Berry <craigberry@mac.com>
Dan Kogai <dankogai@dan.co.jp>
Dave Evans <dave@rudolf.org.uk>
diff --git a/ext/Encode/Changes b/ext/Encode/Changes
index 03c4ef8ff8..481e976d62 100644
--- a/ext/Encode/Changes
+++ b/ext/Encode/Changes
@@ -1,7 +1,17 @@
# Revision history for Perl extension Encode.
#
-# $Id: Changes,v 2.34 2009/07/08 13:34:15 dankogai Exp $
-$Revision: 2.34 $ $Date: 2009/07/08 13:34:15 $
+# $Id: Changes,v 2.35 2009/07/13 02:06:30 dankogai Exp dankogai $
+$Revision: 2.35 $ $Date: 2009/07/13 02:06:30 $
+! lib/Encode/MIME/Header.pm
+ Addressed RT #40027:
+ decode of MIME-Header removes too much whitespace
+ http://rt.cpan.org/Ticket/Display.html?id=40027
+ http://rt.cpan.org/Ticket/Display.html?id=42902
+! t/piconv.t
+ Addressed by CSJEWELL: t/piconv.t loops infinitely on Win32
+ http://rt.cpan.org/Ticket/Display.html?id=47760
+
+2.34 2009/07/08 13:34:15
! bin/piconv
duplicate-BOM problem now fixed.
Message-Id: <10ECB9B7-006E-4570-9EB6-51C49F04ADCF@dan.co.jp>
diff --git a/ext/Encode/Encode.pm b/ext/Encode/Encode.pm
index 307e24146e..4492164228 100644
--- a/ext/Encode/Encode.pm
+++ b/ext/Encode/Encode.pm
@@ -1,10 +1,10 @@
#
-# $Id: Encode.pm,v 2.34 2009/07/08 13:34:59 dankogai Exp $
+# $Id: Encode.pm,v 2.35 2009/07/13 00:49:38 dankogai Exp $
#
package Encode;
use strict;
use warnings;
-our $VERSION = sprintf "%d.%02d", q$Revision: 2.34 $ =~ /(\d+)/g;
+our $VERSION = sprintf "%d.%02d", q$Revision: 2.35 $ =~ /(\d+)/g;
sub DEBUG () { 0 }
use XSLoader ();
XSLoader::load( __PACKAGE__, $VERSION );
diff --git a/ext/Encode/lib/Encode/MIME/Header.pm b/ext/Encode/lib/Encode/MIME/Header.pm
index aba5b3bc2f..9728dc32d8 100644
--- a/ext/Encode/lib/Encode/MIME/Header.pm
+++ b/ext/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.10 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
+our $VERSION = do { my @r = ( q$Revision: 2.11 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use Encode qw(find_encoding encode_utf8 decode_utf8);
use MIME::Base64;
use Carp;
@@ -44,7 +44,7 @@ sub decode($$;$) {
$str =~ s/\?=\s+=\?/\?==\?/gos;
# multi-line header to single line
- $str =~ s/(?:\r\n|[\r\n])[ \t]+//gos;
+ $str =~ s/(?:\r\n|[\r\n])[ \t]//gos;
1 while ( $str =~
s/(=\?[-0-9A-Za-z_]+\?[Qq]\?)(.*?)\?=\1(.*?\?=)/$1$2$3/ )
diff --git a/ext/Encode/t/piconv.t b/ext/Encode/t/piconv.t
index 898d18fcf5..e477f044ee 100644
--- a/ext/Encode/t/piconv.t
+++ b/ext/Encode/t/piconv.t
@@ -1,5 +1,5 @@
#
-# $Id: piconv.t,v 0.1 2009/07/08 12:34:21 dankogai Exp $
+# $Id: piconv.t,v 0.2 2009/07/13 00:50:52 dankogai Exp $
#
BEGIN {
@@ -16,12 +16,19 @@ use IPC::Open3 qw(open3);
use IO::Select;
use Test::More;
+my $WIN = $^O eq 'MSWin32';
+
+if ($WIN) {
+ eval { require IPC::Run; IPC::Run->VERSION(0.83); 1; } or
+ plan skip_all => 'Win32 environments require IPC::Run 0.83 to complete this test';
+}
+
sub run_cmd (;$$);
my $blib =
File::Spec->rel2abs(
- File::Spec->catfile( $FindBin::RealBin, File::Spec->updir, 'blib' ) );
-my $script = "$blib/script/piconv";
+ File::Spec->catdir( $FindBin::RealBin, File::Spec->updir, 'blib' ) );
+my $script = File::Spec->catdir($blib, 'script', 'piconv');
my @base_cmd = ( $^X, "-Mblib=$blib", $script );
plan tests => 5;
@@ -29,7 +36,7 @@ plan tests => 5;
{
my ( $st, $out, $err ) = run_cmd;
is( $st, 0, 'status for usage call' );
- is( $out, undef );
+ is( $out, $WIN ? undef : '' );
like( $err, qr{^piconv}, 'usage' );
}
@@ -45,33 +52,52 @@ plan tests => 5;
sub run_cmd (;$$) {
my ( $args, $in ) = @_;
- $in ||= '';
- my ( $out, $err );
- my ( $in_fh, $out_fh, $err_fh );
- use Symbol 'gensym';
- $err_fh =
- gensym; # sigh... otherwise stderr gets just to $out_fh, not to $err_fh
- my $pid = open3( $in_fh, $out_fh, $err_fh, @base_cmd, @$args )
- or die "Can't run @base_cmd @$args: $!";
- print $in_fh $in;
- my $sel = IO::Select->new( $out_fh, $err_fh );
+
+ my $out = "x" x 10_000;
+ $out = "";
+ my $err = "x" x 10_000;
+ $err = "";
+
+ if ($WIN) {
+ IPC::Run->import(qw(run timeout));
+ my @cmd;
+ if (defined $args) {
+ @cmd = (@base_cmd, @$args);
+ } else {
+ @cmd = @base_cmd;
+ }
+ run(\@cmd, \$in, \$out, \$err, timeout(10));
+ my $st = $?;
+ $out = undef if ($out eq '');
+ ( $st, $out, $err );
+ } else {
+ $in ||= '';
+ my ( $in_fh, $out_fh, $err_fh );
+ use Symbol 'gensym';
+ $err_fh =
+ gensym; # sigh... otherwise stderr gets just to $out_fh, not to $err_fh
+ my $pid = open3( $in_fh, $out_fh, $err_fh, @base_cmd, @$args )
+ or die "Can't run @base_cmd @$args: $!";
+ print $in_fh $in;
+ my $sel = IO::Select->new( $out_fh, $err_fh );
- while ( my @ready = $sel->can_read ) {
- for my $fh (@ready) {
- if ( eof($fh) ) {
- $sel->remove($fh);
- last if !$sel->handles;
- }
- elsif ( $out_fh == $fh ) {
- my $line = <$fh>;
- $out .= $line;
- }
- elsif ( $err_fh == $fh ) {
- my $line = <$fh>;
- $err .= $line;
+ while ( my @ready = $sel->can_read ) {
+ for my $fh (@ready) {
+ if ( eof($fh) ) {
+ $sel->remove($fh);
+ last if !$sel->handles;
+ }
+ elsif ( $out_fh == $fh ) {
+ my $line = <$fh>;
+ $out .= $line;
+ }
+ elsif ( $err_fh == $fh ) {
+ my $line = <$fh>;
+ $err .= $line;
+ }
}
}
+ my $st = $?;
+ ( $st, $out, $err );
}
- my $st = $?;
- ( $st, $out, $err );
}