develooper Front page | perl.perl5.porters | Postings from March 2014

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

Thread Previous
From:
Karl Williamson
Date:
March 27, 2014 17:41
Subject:
Re: [perl #119499] $! returned with UTF-8 flag under UTF-8 localesonly under 5.19.2+
Message ID:
53346303.4080600@khwilliamson.com
On 03/27/2014 04:57 AM, Aristotle Pagaltzis wrote:
> * Karl Williamson <public@khwilliamson.com> [2014-03-27 03:10]:
>> Another possibility to get programs like ack to work unchanged is to
>> add a non-printing above-Latin1 character to the stringification of $!
>> when it is UTF-8 and there are only Latin1 characters in it.
>> A possibility is a ZERO WIDTH SPACE. Then do_print() wouldn't try to
>> downgrade. The drawback is that code that analyzes $! could be thrown
>> off. But code generally should be analyzing the numeric value anyway,
>> and not the string representation
>
> Maybe you can attach magic that prevents a downgrade?
>

That sounds like a better approach, but it is an area that I know 
essentially nothing about.  If I were to do it, it seems not so likely 
that I could get it right by 5.20; I don't know how hard it would be for 
someone experienced in the magical arts of Perlâ„¢.

Likewise, adding the ZERO WIDTH SPACE would need to be done early in the 
development cycle to see what might break, not late, so shouldn't be 
considered as a 5.20 solution.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About