#
-# $Id: Encode.pm,v 2.22 2007/05/29 07:35:27 dankogai Exp dankogai $
+# $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.22 $ =~ /(\d+)/g;
+our $VERSION = sprintf "%d.%02d", q$Revision: 2.35 $ =~ /(\d+)/g;
sub DEBUG () { 0 }
use XSLoader ();
XSLoader::load( __PACKAGE__, $VERSION );
our %EXPORT_TAGS = (
all => [ @EXPORT, @EXPORT_OK ],
- fallbacks => [@FB_CONSTS],
+ default => [ @EXPORT ],
+ fallbacks => [ @FB_CONSTS ],
fallback_all => [ @FB_CONSTS, @FB_FLAGS ],
);
our %Encoding;
our %ExtModule;
require Encode::Config;
-eval { require Encode::ConfigLocal };
+# See
+# https://bugzilla.redhat.com/show_bug.cgi?id=435505#c2
+# to find why sig handers inside eval{} are disabled.
+eval {
+ local $SIG{__DIE__};
+ local $SIG{__WARN__};
+ require Encode::ConfigLocal;
+};
sub encodings {
my $class = shift;
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;
=back
-=Head2 coderef for CHECK
+=head2 coderef for CHECK
As of Encode 2.12 CHECK can also be a code reference which takes the
ord value of unmapped caharacter as an argument and returns a string
state of the UTF8 flag (so please don't treat the return value as
indicating success or failure), or C<undef> if STRING is not a string.
+This function does not work on tainted values.
+
=item _utf8_off(STRING)
[INTERNAL] Turns off the UTF8 flag in STRING. Do not use frivolously.
return value as indicating success or failure), or C<undef> if STRING is
not a string.
+This function does not work on tainted values.
+
=back
=head1 UTF-8 vs. utf8 vs. UTF8
L<encoding>,
L<perlebcdic>,
L<perlfunc/open>,
-L<perlunicode>,
+L<perlunicode>, L<perluniintro>, L<perlunifaq>, L<perlunitut>
L<utf8>,
the Perl Unicode Mailing List E<lt>perl-unicode@perl.orgE<gt>