Encode::decode() clears scalar being decoded?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

if I run the following script:


use Encode qw/decode/;

my $string = "B36rsen Feiertag";
print "string=[$string]\n";

my $tmp = decode('utf8', $string, 1);
print "string=[$string], tmp=[$tmp]\n";

I get the following output:

string=[Börsen Feiertag]
string=[], tmp=[B?sen Feiertag]

What happened to $string?  There is no mention of side-effects in the Encode
manpage... This only happens when CHECK is set to 1.


Rob Urban

Re: Encode::decode() clears scalar being decoded?

On Thu, 23 Apr 2009 02:05:14 +0200, Robert Urban wrote:

Quoted text here. Click to load it

I get the same result.

I think it's a bug in Encode.

Site Timeline