diff options
author | Karl Williamson <khw@cpan.org> | 2014-06-01 14:05:48 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2014-06-05 11:23:00 -0600 |
commit | 4c28b29c7a1549f173177cdf69e91cc1acaa0969 (patch) | |
tree | 2e0acd888a404f38bc67ab77542b2e82e74615e7 /locale.c | |
parent | c5a7e38ee268d066630473beab3ef7aca53fd728 (diff) | |
download | perl-4c28b29c7a1549f173177cdf69e91cc1acaa0969.tar.gz |
Keep LC_NUMERIC in C locale, except for brief periods
This is for XS modules, so they don't have to worry about the radix
being a non-dot. When the locale needs to be in the underlying one, the
operation should be wrapped using macros for the purpose. That API may
change as we gain experience in 5.21, so I'm not including it now.
Diffstat (limited to 'locale.c')
-rw-r--r-- | locale.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -180,6 +180,12 @@ Perl_new_numeric(pTHX_ const char *newnum) PL_numeric_standard = ((*save_newnum == 'C' && save_newnum[1] == '\0') || strEQ(save_newnum, "POSIX")); PL_numeric_local = TRUE; + + /* Keep LC_NUMERIC in the C locale. This is for XS modules, so they don't + * have to worry about the radix being a non-dot. (Core operations that + * need the underlying locale change to it temporarily). */ + set_numeric_standard(); + set_numeric_radix(); #endif /* USE_LOCALE_NUMERIC */ |