summaryrefslogtreecommitdiff
path: root/ext/Encode
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2009-03-07 14:55:32 +0100
committerDavid Mitchell <davem@iabyn.com>2009-04-15 21:49:47 +0100
commit8568b4445ec3e4e424d806025798f31eaacd58e9 (patch)
treeaee08ea7efabaa927d1f573306e161be7858f102 /ext/Encode
parent2647e3d54952c6011fd2232f3bf2e62b92a0132d (diff)
downloadperl-8568b4445ec3e4e424d806025798f31eaacd58e9.tar.gz
Update to Encode 2.32
(cherry picked from commit 4e71788c753f3f1e3668bcc2e7eae57e95c676e8)
Diffstat (limited to 'ext/Encode')
-rw-r--r--ext/Encode/AUTHORS1
-rw-r--r--ext/Encode/Changes14
-rw-r--r--ext/Encode/Encode.pm8
-rw-r--r--ext/Encode/lib/Encode/Alias.pm4
-rw-r--r--ext/Encode/t/Aliases.t1
5 files changed, 22 insertions, 6 deletions
diff --git a/ext/Encode/AUTHORS b/ext/Encode/AUTHORS
index 022a3c45c7..c928a3200c 100644
--- a/ext/Encode/AUTHORS
+++ b/ext/Encode/AUTHORS
@@ -33,6 +33,7 @@ Jarkko Hietaniemi <jhi@iki.fi>
Jungshik Shin <jshin@mailaps.org>
KONNO Hiroharu <hiroharu.konno@bowneglobal.co.jp>
Laszlo Molnar <ml1050@freemail.hu>
+MATSUNO Tokuhiro <tokuhirom+cpan@gmail.com>
MORIYAMA Masayuki <msyk@mtg.biglobe.ne.jp>
Makamaka <makamaka@donzoko.net>
Mark-Jason Dominus <mjd@plover.com>
diff --git a/ext/Encode/Changes b/ext/Encode/Changes
index 1828e49861..6c6816638c 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 b0344d1fb8..ffaf9b8c38 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 5fb12e4b0e..f142403ca9 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 716cb8ce6d..fd088d5275 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',