diff options
author | Karl Williamson <public@khwilliamson.com> | 2013-07-08 14:04:45 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2013-07-09 22:23:24 -0600 |
commit | ccd65d51403426e176072af492d832677521af9f (patch) | |
tree | 359542528a229d2014d01df0ad44a1d87768dde0 /perl.h | |
parent | a77c16f7c797af630db968764807f48bed555b91 (diff) | |
download | perl-ccd65d51403426e176072af492d832677521af9f.tar.gz |
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.
Diffstat (limited to 'perl.h')
-rw-r--r-- | perl.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -691,6 +691,8 @@ struct op *Perl_op asm(stringify(OP_IN_REGISTER)); #if !defined(NO_LOCALE) && defined(HAS_SETLOCALE) # define USE_LOCALE +# define HAS_SKIP_LOCALE_INIT /* Solely for XS code to test for this + capability */ # if !defined(NO_LOCALE_COLLATE) && defined(LC_COLLATE) \ && defined(HAS_STRXFRM) # define USE_LOCALE_COLLATE |