develooper Front page | perl.perl5.porters | Postings from June 2011

Re: RFC: Handling utf8 locales

Thread Previous | Thread Next
From:
Karl Williamson
Date:
June 26, 2011 11:46
Subject:
Re: RFC: Handling utf8 locales
Message ID:
4E077E76.9010001@khwilliamson.com
On 06/26/2011 05:17 AM, Leon Timmermans wrote:
> On Sun, Jun 26, 2011 at 10:33 AM, Zefram<zefram@fysh.org>  wrote:
>> We should discourage the use of locale-encoded strings within Perl space.
>> We should encourage decoding on input, encoding on output, and using
>> native Unicode representation in the middle.  To this end, there should
>> be a PerlIO layer :locale, which {de,en}codes according to the locale's
>> preferred encoding.  The locale's encoding may perfectly well be UTF-8,
>> and in *this* context we can handle it in an entirely regular manner,
>> on a par with ISO-8859-*.
>
> There is such a module on CPAN, but it's currently broken by design. I
> think I just fixed that in my repo, though that involved a complete
> rewrite. I think this module may be a good candidate for core in 5.16.

+1 to this, though the documentation needs more beefing up.  I was left 
wondering about how good the locale guessing is, and what happens if it 
guesses wrong, or does it always give a warning or failure in such 
circumstances.  Also, I wonder about tainting issues.  And, there should 
be a way to automatically load it.


Thread Previous | Thread Next


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