Skip Menu |

This queue is for tickets about the Encode CPAN distribution.

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

People
Owner: DANKOGAI [...] cpan.org
Requestors: GAAS [...] cpan.org
Cc:
AdminCc:

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



Subject: (de|en)code($valid_encoding, undef) does not warn
The documentation claims that undef warns. This is not true as there is a check for undef at the beginning of both encode and decode that prevents that. Attached is a doc patch to match the docs with the implementation.
==== //depot/users/gisle/hacks/contrib/Encode-2/Encode.pm#5 - /home/gisle/hacks/contrib/Encode-2/Encode.pm ==== Index: users/gisle/hacks/contrib/Encode-2/Encode.pm --- users/gisle/hacks/contrib/Encode-2/Encode.pm.~1~ Fri Dec 3 15:25:28 2004 +++ users/gisle/hacks/contrib/Encode-2/Encode.pm Fri Dec 3 15:25:28 2004 @@ -401,9 +401,7 @@ the result is always off, even when it contains completely valid utf8 string. See L</"The UTF-8 flag"> below. -encode($valid_encoding, undef) is harmless but warns you for -C<Use of uninitialized value in subroutine entry>. -encode($valid_encoding, '') is harmless and warnless. +If the $string is C<undef> or a reference then C<undef> is returned. =item $string = decode(ENCODING, $octets [, CHECK]) @@ -423,9 +421,7 @@ ASCII data (or EBCDIC on EBCDIC machines). See L</"The UTF-8 flag"> below. -decode($valid_encoding, undef) is harmless but warns you for -C<Use of uninitialized value in subroutine entry>. -decode($valid_encoding, '') is harmless and warnless. +If the $string is C<undef> or a reference then C<undef> is returned. =item [$length =] from_to($octets, FROM_ENC, TO_ENC [, CHECK]) End of Patch.