[BJOERN - Thu Oct 21 13:07:16 2004]:
Show quoted text> With Encode.pm 2.02
>
> decode('utf-8', bless({},'x'))
>
> causes Perl to crash on Win32.
It does crash on Mac OS X, too. The patch below will fix it or you can wait for the next
version of Encode. Thank you for your report.
Dan the Encode Maintainer
--- Encode.pm 2004/10/19 04:54:43 2.5
+++ Encode.pm 2004/10/22 04:48:58
@@ -140,6 +140,7 @@
{
my ($name, $string, $check) = @_;
return undef unless defined $string;
+ return undef if ref $string;
$check ||=0;
my $enc = find_encoding($name);
unless(defined $enc){
@@ -155,6 +156,7 @@
{
my ($name,$octets,$check) = @_;
return undef unless defined $octets;
+ return undef if ref $octets;
$check ||=0;
my $enc = find_encoding($name);
unless(defined $enc){