Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Announce: encoding-warnings 0.01.

0 views
Skip to first unread message

Autrijus Tang

unread,
Mar 14, 2004, 9:44:52 AM3/14/04
to perl5-...@perl.org, perl5-...@perl.org
So, in my attempt to speak in code (instead of|in addition to) words,
here is the first version of encoding::warnings, freshly uploaded to
CPAN:

http://aut.dyndns.org/dist/encoding-warnings-0.01.tar.gz
MD5 (encoding-warnings-0.01.tar.gz) = 89e1fa363811a0a6fd612d85ba12480d

It simplifies the process of diagnosing problems caused by silent
upgrading of byte strings (treated as in latin1 encoding) into unicode
strings. Just put this line on top of the main program:

use encoding::warnings;

Afterwards, implicit upgrading of high-bit bytes will raise a warning
likes this:

Bytes implicitly upgraded into wide characters as iso-8859-1 at - line 7.

You can also make the warnings fatal by saying:

use encoding::warnings 'FATAL';

Also included in its POD is three common methods of properly resolving
such problems. If you are aware of alternative methods, and/or
shortcomings in the documentation, I'd love to hear about them.

I will work with MJD's lexical patches in the coming days, and make this
module (and also encoding.pm) truly lexical. I'd also be very happy to
see this warning incoporated into the core warnings some day.

Thanks,
/Autrijus/

signature.asc
0 new messages