From 9770d8e9eebf92b16586bdbb67972b5c7f25b6ab Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 15 Apr 2021 20:25:03 -0600 Subject: [PATCH] lib/locale.t: Use I18N::Langinfo, not POSIX::localeconv() Now that Langinfo is ported to every box, it requires less work than localeconv(), and offers more choices. This commit changes to use it, and for more info when debugging, gets some additional info from it. --- lib/locale.t | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/locale.t b/lib/locale.t index 8559a912fca4..be27a1b95302 100644 --- a/lib/locale.t +++ b/lib/locale.t @@ -54,6 +54,7 @@ BEGIN { } use feature 'fc'; +use I18N::Langinfo qw(langinfo CODESET CRNCYSTR RADIXCHAR); # =1 adds debugging output; =2 increases the verbosity somewhat our $debug = $ENV{PERL_DEBUG_FULL_TEST} // 0; @@ -1052,9 +1053,11 @@ foreach my $Locale (@Locale) { my $is_utf8_locale = is_locale_utf8($Locale); + debug "code set = " . langinfo(CODESET); debug "is utf8 locale? = $is_utf8_locale\n"; - debug "radix = " . disp_str(localeconv()->{decimal_point}) . "\n"; + debug "radix = " . disp_str(langinfo(RADIXCHAR)); + debug "currency = " . disp_str(langinfo(CRNCYSTR)); if (! $is_utf8_locale) { use locale; @@ -2429,7 +2432,7 @@ foreach my $Locale (@Locale) { $test_names{$locales_test_number} = 'Verify atof with locale radix and negative exponent'; $problematical_tests{$locales_test_number} = 1; - my $radix = POSIX::localeconv()->{decimal_point}; + my $radix = langinfo(RADIXCHAR); my @nums = ( "3.14e+9", "3${radix}14e+9", "3.14e-9", "3${radix}14e-9", "-3.14e+9", "-3${radix}14e+9", "-3.14e-9", "-3${radix}14e-9",