CODE:
#ifdef HAS_LOCALECONV
struct lconv *lcbuf;
+
+ /* localeconv() deals with both LC_NUMERIC and LC_MONETARY, but
+ * LC_MONETARY is already in the correct locale */
+ STORE_NUMERIC_STANDARD_FORCE_LOCAL();
+
RETVAL = newHV();
sv_2mortal((SV*)RETVAL);
if ((lcbuf = localeconv())) {
strlen(integers->name), newSViv(value), 0);
} while ((++integers)->name);
}
+ RESTORE_NUMERIC_STANDARD();
#else
localeconv(); /* A stub to call not_here(). */
#endif
our ($AUTOLOAD, %SIGRT);
-our $VERSION = '1.39';
+our $VERSION = '1.40';
require XSLoader;
=item C<localeconv>
Get numeric formatting information. Returns a reference to a hash
-containing the current locale formatting values. Users of this function
+containing the current underlying locale's formatting values. Users of this function
should also read L<perllocale>, which provides a comprehensive
discussion of Perl locale handling, including
L<a section devoted to this function|perllocale/The localeconv function>.
Win32 builds was fixed. This might affect embedders who repeatedly create and
destroy perl engines within the same process.
+=item *
+
+C<POSIX::localeconv()> now returns the data for the program's underlying
+locale even when called from outside the scope of S<C<use locale>>.
+
=back
=head1 Known Problems
The C<POSIX::localeconv()> function allows you to get particulars of the
locale-dependent numeric formatting information specified by the current
-C<LC_NUMERIC> and C<LC_MONETARY> locales. (If you just want the name of
+underlying C<LC_NUMERIC> and C<LC_MONETARY> locales (regardless of
+whether called from within the scope of C<S<use locale>> or not). (If
+you just want the name of
the current locale for a particular category, use C<POSIX::setlocale()>
with a single parameter--see L<The setlocale function>.)
}
{
+ fresh_perl_is(<<'EOF', ",,", {},
+print localeconv()->{decimal_point};
+use POSIX;
+use locale;
+print localeconv()->{decimal_point};
+EOF
+ "localeconv() looks at LC_NUMERIC with and without 'use locale'");
+ }
+
+ {
fresh_perl_is(<<'EOF', $difference, {},
use locale ":not_characters";
format STDOUT =
}
-sub last { 19 }
+sub last { 20 }