develooper Front page | perl.perl5.porters | Postings from September 2013

Re: [perl #119499] $! returned with UTF-8 flag under UTF-8 localesonly under 5.19.2+

Thread Previous | Thread Next
Karl Williamson
September 1, 2013 17:15
Re: [perl #119499] $! returned with UTF-8 flag under UTF-8 localesonly under 5.19.2+
Message ID:
On 09/01/2013 10:47 AM, Victor Efimov wrote:
> 2013/9/1 Leon Timmermans < <>>
>     $! is inherently a piece of text, not piece of binary data. As such,
>     it makes perfect sense to treat it as such an automatically decode
>     it. The same is not necessarily true for your other examples.
> btw, interesting that $^E is not affected by this change, i.e when $! is
> same as $^E (I tested on linux only), $^E does not have utf-8 flag,
> while $! has.

I've been wondering myself what should happen with $^E, and I believe 
the two should be made consistent.

Some other thoughts I've had about this issue.

The commit did not break the ISO 646 7-bit codings, as the behavior is 
unchanged for those.

Those encodings must not be very important nor have been for quite some 
time, as it does not appear that Encode supports them.

We could have a feature automatically turned on in v5.20.  I'll call it 
'errno' for now ('mauve' having been taken ;) ).

Without it being on, $! works as it did in <=v5.18.

Within its scope Perl attempts to decode $! as best it can, autoloading 
Encode and trying to determine the locale using nl_langinfo() if available.

This may be a crazy idea; but I thought I'd put it out there to 
stimulate discussion

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About