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