perl-unicode

Encode-2.07 vs. PerlIO::encoding

2004-10-23 22:30:07
On Oct 24, 2004, at 06:41, Rafael Garcia-Suarez wrote:
Dan Kogai wrote:
Within less than 24hrs I resorted to release version 2.07.  What the
heck.  5.8.6 is soon....

I applied 2.07 to bleadperl, and looks like something is broken in
PerlIO::encoding.
More precisely, ext/PerlIO/t/encoding.t fails test 14, that tests
open(F,'<:encoding(utf-8)',$threebyte).

The easiest solution is the patch below;

--- ext/PerlIO/encoding/encoding.pm.dist        Sat May 24 00:38:36 2003
+++ ext/PerlIO/encoding/encoding.pm Sun Oct 24 13:38:45 2004
@@ -12,7 +12,7 @@
 use XSLoader ();
 XSLoader::load(__PACKAGE__, $VERSION);

-our $fallback = Encode::PERLQQ()|Encode::WARN_ON_ERR();
+our $fallback = Encode::PERLQQ()|Encode::WARN_ON_ERR()|Encode::RETURN_ON_ERR();

 1;
 __END__

This makes perl-5.8.6 happy but the problem is that I have made Encode::utf8 so that it accepts fallback values like Encode::XS (upon the request by Bjoern Hoehrmann via RT). Encode::utf8 used to return immediately at partial character but now Encode:RETURN_ON_ERR is required, meaning those who installed Encode-2.07 on older perl are in trouble w/ PerlIO. So I am looking for a solution which does that without tweaking PerlIO::encoding.

I just want Encode::utf8->decode() to make sure Encode:RETURN_ON_ERR is on when the callar is PerlIO::encoding...

Dan the Encode Maintainer

<Prev in Thread] Current Thread [Next in Thread>