Attempt to fix core-specific logic in IPC::Open2 tests
[p5sagit/p5-mst-13.2.git] / ext / Encode / Encode.pm
index b0344d1..4492164 100644 (file)
@@ -1,10 +1,10 @@
 #
-# $Id: Encode.pm,v 2.31 2009/02/16 06:13:11 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.31 $ =~ /(\d+)/g;
+our $VERSION = sprintf "%d.%02d", q$Revision: 2.35 $ =~ /(\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;