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

Re: use locale

Thread Previous | Thread Next
Gisle Aas
March 13, 2011 06:30
Re: use locale
Message ID:
On Mar 13, 2011, at 6:45, Zsbán Ambrus wrote:

> On Sat, Mar 12, 2011 at 11:27 PM, demerphq <> wrote:
>> On 12 March 2011 23:00, Zsbán Ambrus <> wrote:
>>> On Sat, Mar 12, 2011 at 12:37 PM, demerphq <> wrote:
>>>> I consider "use locale" broken and preserved only for backwards
>>>> compatibility. IMO we should get rid of it, deprecate it, whatever.
>>> Er what?  How do I do a locale-aware string compare without it?  I'm
>>> not supposed to call POSIX::strcoll?
>> Its a personal opinion. Please let us know how you use it and why.
> Well, just because you ask.  I personally have exactly two uses for
> locales (but I don't deny that other people may have more needs).
> The first use is to let various programs guess the encoding of the
> terminal from it.

I found the same need recently and ended up with creating
Encode::Locale [1].  It tries to use locale where it applies and other similar
means where it doesn't (like Windows). The locale is also a good guess
for the encoding of @ARGV and %ENV.  It also tries to address the
encoding for file names.



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