Skip Menu |

This queue is for tickets about the Encode CPAN distribution.

Report information
The Basics
Id: 38652
Status: resolved
Priority: 0/
Queue: Encode

People
Owner: Nobody in particular
Requestors: bkb [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 2.26
Fixed in: (no value)



Subject: Empty file should produce an error message
While writing test scripts, I found the following. If the string is completely empty, Encode::Guess->guess returns an undefined value. The documentation says that it returns an error message. #!perl -wl use Encode::Guess qw/utf8 cp932 ascii/; my $decoder = Encode::Guess->guess (''); print ref ($decoder); print $decoder; You may think that no-one would be stupid enough to do this, but in fact I was. Would be nice to get an error message like "empty input".
Thanks, address in version 2.27. Dan the Encode Maintainer On Fri Aug 22 03:38:22 2008, BKB wrote: Show quoted text
> While writing test scripts, I found the following. If the string is > completely empty, Encode::Guess->guess returns an undefined value. The > documentation says that it returns an error message. > > #!perl -wl > use Encode::Guess qw/utf8 cp932 ascii/; > my $decoder = Encode::Guess->guess (''); > print ref ($decoder); > print $decoder; > > You may think that no-one would be stupid enough to do this, but in fact > I was. Would be nice to get an error message like "empty input". >