From: Rafael Garcia-Suarez Date: Sat, 7 Mar 2009 13:55:32 +0000 (+0100) Subject: Update to Encode 2.32 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4e71788c753f3f1e3668bcc2e7eae57e95c676e8;p=p5sagit%2Fp5-mst-13.2.git Update to Encode 2.32 --- diff --git a/ext/Encode/AUTHORS b/ext/Encode/AUTHORS index 022a3c4..c928a32 100644 --- a/ext/Encode/AUTHORS +++ b/ext/Encode/AUTHORS @@ -33,6 +33,7 @@ Jarkko Hietaniemi Jungshik Shin KONNO Hiroharu Laszlo Molnar +MATSUNO Tokuhiro MORIYAMA Masayuki Makamaka Mark-Jason Dominus diff --git a/ext/Encode/Changes b/ext/Encode/Changes index 1828e49..6c68166 100644 --- a/ext/Encode/Changes +++ b/ext/Encode/Changes @@ -1,8 +1,18 @@ # Revision history for Perl extension Encode. # -# $Id: Changes,v 2.31 2009/02/16 06:18:09 dankogai Exp dankogai $ +# $Id: Changes,v 2.32 2009/03/07 07:32:37 dankogai Exp dankogai $ # -$Revision: 2.31 $ $Date: 2009/02/16 06:18:09 $ +$Revision: 2.32 $ $Date: 2009/03/07 07:32:37 $ +! lib/Encode/Alias.pm t/Alias.t + Encode now resolves 'en_US.UTF-8' to utf-8-strict like 'ja_JP.euc' + Those who set locale on their shells should be happier now. +! AUTHORS + added tokuhirom +! Encode.pm + "encode(undef, 'str') should die earlier" + http://coderepos.org/share/changeset/30790 + +2.31 2009/02/16 06:18:09 ! lib/Encode/MIME/Header.pm "Revert [29767] and [29771] since it breaks perl 5.8" by miyagawa http://coderepos.org/share/changeset/30111 diff --git a/ext/Encode/Encode.pm b/ext/Encode/Encode.pm index b0344d1..ffaf9b8 100644 --- a/ext/Encode/Encode.pm +++ b/ext/Encode/Encode.pm @@ -1,10 +1,10 @@ # -# $Id: Encode.pm,v 2.31 2009/02/16 06:13:11 dankogai Exp $ +# $Id: Encode.pm,v 2.32 2009/03/07 07:32:37 dankogai Exp dankogai $ # package Encode; use strict; use warnings; -our $VERSION = sprintf "%d.%02d", q$Revision: 2.31 $ =~ /(\d+)/g; +our $VERSION = sprintf "%d.%02d", q$Revision: 2.32 $ =~ /(\d+)/g; sub DEBUG () { 0 } use XSLoader (); XSLoader::load( __PACKAGE__, $VERSION ); @@ -146,6 +146,10 @@ sub encode($$;$) { return undef unless defined $string; $string .= '' if ref $string; # stringify; $check ||= 0; + unless ( defined $name ) { + require Carp; + Carp::croak("Encoding name should not be undef"); + } my $enc = find_encoding($name); unless ( defined $enc ) { require Carp; diff --git a/ext/Encode/lib/Encode/Alias.pm b/ext/Encode/lib/Encode/Alias.pm index 5fb12e4b..f142403 100644 --- a/ext/Encode/lib/Encode/Alias.pm +++ b/ext/Encode/lib/Encode/Alias.pm @@ -2,7 +2,7 @@ package Encode::Alias; use strict; use warnings; no warnings 'redefine'; -our $VERSION = do { my @r = ( q$Revision: 2.11 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; +our $VERSION = do { my @r = ( q$Revision: 2.12 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; sub DEBUG () { 0 } use base qw(Exporter); @@ -256,7 +256,7 @@ sub init_aliases { } # utf8 is blessed :) - define_alias( qr/^UTF-8$/i => '"utf-8-strict"' ); + define_alias( qr/\bUTF-8$/i => '"utf-8-strict"' ); # At last, Map white space and _ to '-' define_alias( qr/^(\S+)[\s_]+(.*)$/i => '"$1-$2"' ); diff --git a/ext/Encode/t/Aliases.t b/ext/Encode/t/Aliases.t index 716cb8c..fd088d5 100644 --- a/ext/Encode/t/Aliases.t +++ b/ext/Encode/t/Aliases.t @@ -23,6 +23,7 @@ sub init_a2c{ 'US-ascii' => 'ascii', 'ISO-646-US' => 'ascii', 'UTF-8' => 'utf-8-strict', + 'en_US.UTF-8' => 'utf-8-strict', 'UCS-2' => 'UCS-2BE', 'UCS2' => 'UCS-2BE', 'iso-10646-1' => 'UCS-2BE',