On Thu Jul 25 23:01:31 2013, lav@yar.ru wrote: > utf8::decode replaces undef with an empty string. This code snippet > illustrates the problem. > > use utf8; > my $value=undef; > utf8::decode($value); > print defined($value)?"ERROR":"OK","\n"; > > perl-5.14.4 did not have this bug. This was an intentional change, necessary to fix a bug (#91850). Objects with string overloading were not being decoded. utf8::decode($such_an_obj) simply did nothing. So we had to change it to stringify its argument first. That had the side effect of changing undef to "", which is actually logical, because decoding is a string operation. It also makes utf8::decode consistent with utf8::encode, which has always changed undef to "", or at least as far as I can remember. -- Father Chrysostomos --- via perlbug: queue: perl5 status: new https://rt.perl.org:443/rt3/Ticket/Display.html?id=119027Thread Previous | Thread Next