This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PATCH: [perl #38193] embedded perl always calls setlocale(LC_ALL,"")
authorKarl Williamson <public@khwilliamson.com>
Mon, 8 Jul 2013 20:04:45 +0000 (14:04 -0600)
committerKarl Williamson <public@khwilliamson.com>
Wed, 10 Jul 2013 04:23:24 +0000 (22:23 -0600)
commitccd65d51403426e176072af492d832677521af9f
tree359542528a229d2014d01df0ad44a1d87768dde0
parenta77c16f7c797af630db968764807f48bed555b91
PATCH: [perl #38193] embedded perl always calls setlocale(LC_ALL,"")

This commit causes the locale initialization to skip calling
setlocal(foo, "") if the environment variable PERL_SKIP_LOCALE_INIT is
set.  Instead, the setup code calls setlocale(LC_ALL, NULL) (plus other
similar calls for the subcategories) in order to find out what the
current locale is.

The original poster for this ticket has a workaround for it which
involves using a modified copy of Perl core code.  This patch defines
the C preprocessor variable HAS_SKIP_LOCALE_INIT that can be used by XS
writers to discover if the current Perl version needs the workaround or
not.

I was unable to come up with a test for this patch that did not involve
building extensive infrastructure for testing embedded Perl.  That does
not seem worth it for such a trivial patch.  I tested by hand.
locale.c
perl.h
pod/perlembed.pod
pod/perllocale.pod