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
From:
Karl Williamson
Date:
September 1, 2013 16:24
Subject:
Re: [perl #119499] $! returned with UTF-8 flag under UTF-8 localesonly under 5.19.2+
Message ID:
52236A0E.8040501@khwilliamson.com
On 08/31/2013 10:36 PM, Karl Williamson wrote:
> I feel compelled to point out that this code is buggy.  I18N::Langinfo
> is not portable to all platforms that Perl runs on, and CODESET gives
> the locale of LC_CTYPE, which may not be the same locale that $! is
> returned in: LC_MESSAGES. (Note that the code could be modified to
> change LC_CTYPE to the locale of LC_MESSAGES temporarily around the
> langinfo call to addess this bug.)  Also, some vendors' nl_langinfo()
> was, at the time, so buggy that the core .t for this doesn't do any
> "real" testing.
> http://perl5.git.perl.org/perl.git/blame/HEAD:/ext/I18N-Langinfo/t/Langinfo.

I now feel compelled to point out that I should have been more clear 
that this code is fine, not buggy, if used in the environment in which 
it was likely designed for.  On a platform with a working nl_langinfo() 
and the programmer knows that LC_MESSAGES and LC_CTYPE are always in 
sync, this worked well, until I broke 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