@@ -2950,10 +2950,10 @@ S_save_to_buffer(const char * string, const char **buf, Size_t *buf_size)
2950
2950
}
2951
2951
2952
2952
STATIC utf8ness_t
2953
- S_get_locale_string_utf8ness_i (pTHX_ const char * locale ,
2954
- const unsigned cat_index ,
2955
- const char * string ,
2956
- const locale_utf8ness_t known_utf8 )
2953
+ S_get_locale_string_utf8ness_i (pTHX_ const char * string ,
2954
+ const locale_utf8ness_t known_utf8 ,
2955
+ const char * locale ,
2956
+ const unsigned cat_index )
2957
2957
{
2958
2958
PERL_ARGS_ASSERT_GET_LOCALE_STRING_UTF8NESS_I ;
2959
2959
assert (cat_index <= NOMINAL_LC_ALL_INDEX );
@@ -3056,7 +3056,7 @@ Perl_get_win32_message_utf8ness(pTHX_ const char * string)
3056
3056
* locale and category completely.
3057
3057
*
3058
3058
* This is because Windows doesn't have LC_MESSAGES */
3059
- return get_locale_string_utf8ness_i (NULL , 0 , string , LOCALE_IS_UTF8 );
3059
+ return get_locale_string_utf8ness_i (string , LOCALE_IS_UTF8 , NULL , 0 );
3060
3060
}
3061
3061
3062
3062
# endif
@@ -3534,10 +3534,10 @@ S_populate_localeconv(pTHX_ const struct lconv *lcbuf,
3534
3534
const char * value = * ((const char * * )(ptr + strings -> offset ));
3535
3535
if (value ) {
3536
3536
bool is_utf8 = /* Only make UTF-8 if required to */
3537
- (UTF8NESS_YES == (get_locale_string_utf8ness_i (locale ,
3538
- cat_index ,
3539
- value ,
3540
- locale_is_utf8 )));
3537
+ (UTF8NESS_YES == (get_locale_string_utf8ness_i (value ,
3538
+ locale_is_utf8 ,
3539
+ locale ,
3540
+ cat_index )));
3541
3541
(void ) hv_store (retval ,
3542
3542
strings -> name ,
3543
3543
strlen (strings -> name ),
@@ -3990,8 +3990,9 @@ S_my_langinfo_i(pTHX_
3990
3990
retval = save_to_buffer (nl_langinfo_l (item , cur ), retbufp , retbuf_sizep );
3991
3991
3992
3992
if (utf8ness ) {
3993
- * utf8ness = get_locale_string_utf8ness_i (locale , cat_index , retval ,
3994
- LOCALE_UTF8NESS_UNKNOWN );
3993
+ * utf8ness = get_locale_string_utf8ness_i (retval ,
3994
+ LOCALE_UTF8NESS_UNKNOWN ,
3995
+ locale , cat_index );
3995
3996
}
3996
3997
3997
3998
freelocale (cur );
@@ -4017,8 +4018,9 @@ S_my_langinfo_i(pTHX_
4017
4018
gwLOCALE_UNLOCK ;
4018
4019
4019
4020
if (utf8ness ) {
4020
- * utf8ness = get_locale_string_utf8ness_i (locale , cat_index ,
4021
- retval , LOCALE_UTF8NESS_UNKNOWN );
4021
+ * utf8ness = get_locale_string_utf8ness_i (retval ,
4022
+ LOCALE_UTF8NESS_UNKNOWN ,
4023
+ locale , cat_index );
4022
4024
}
4023
4025
4024
4026
restore_toggled_locale_i (cat_index , orig_switched_locale );
@@ -4111,9 +4113,9 @@ S_my_langinfo_i(pTHX_
4111
4113
Safefree (floatbuf );
4112
4114
4113
4115
if (utf8ness ) {
4114
- is_utf8 = get_locale_string_utf8ness_i (locale , cat_index ,
4115
- retval ,
4116
- LOCALE_UTF8NESS_UNKNOWN );
4116
+ is_utf8 = get_locale_string_utf8ness_i (retval ,
4117
+ LOCALE_UTF8NESS_UNKNOWN ,
4118
+ locale , cat_index );
4117
4119
}
4118
4120
4119
4121
break ;
@@ -4149,8 +4151,9 @@ S_my_langinfo_i(pTHX_
4149
4151
retval = save_to_buffer (SvPV_nolen (string ), retbufp , retbuf_sizep );
4150
4152
4151
4153
if (utf8ness ) {
4152
- is_utf8 = get_locale_string_utf8ness_i (locale , cat_index , retval ,
4153
- LOCALE_UTF8NESS_UNKNOWN );
4154
+ is_utf8 = get_locale_string_utf8ness_i (retval ,
4155
+ LOCALE_UTF8NESS_UNKNOWN ,
4156
+ locale , cat_index );
4154
4157
}
4155
4158
4156
4159
SvREFCNT_dec_NN (string );
@@ -4565,8 +4568,9 @@ Perl_my_strftime8(pTHX_ const char *fmt, int sec, int min, int hour, int mday,
4565
4568
if (utf8ness ) {
4566
4569
4567
4570
#ifdef USE_LOCALE_TIME
4568
- * utf8ness = get_locale_string_utf8ness_i (NULL , LC_TIME_INDEX_ ,
4569
- retval , LOCALE_UTF8NESS_UNKNOWN );
4571
+ * utf8ness = get_locale_string_utf8ness_i (retval ,
4572
+ LOCALE_UTF8NESS_UNKNOWN ,
4573
+ NULL , LC_TIME_INDEX_ );
4570
4574
#else
4571
4575
* utf8ness = UTF8NESS_IMMATERIAL ;
4572
4576
#endif
@@ -6406,8 +6410,8 @@ Perl_my_strerror(pTHX_ const int errnum, utf8ness_t * utf8ness)
6406
6410
: use_curlocale_scratch ();
6407
6411
6408
6412
const char * errstr = savepv (strerror_l (errnum , which_obj ));
6409
- * utf8ness = get_locale_string_utf8ness_i (NULL , WHICH_LC_INDEX , errstr ,
6410
- LOCALE_UTF8NESS_UNKNOWN );
6413
+ * utf8ness = get_locale_string_utf8ness_i (errstr , LOCALE_UTF8NESS_UNKNOWN ,
6414
+ NULL , WHICH_LC_INDEX );
6411
6415
DEBUG_STRERROR_RETURN (errstr , utf8ness );
6412
6416
6413
6417
SAVEFREEPV (errstr );
@@ -6436,8 +6440,9 @@ Perl_my_strerror(pTHX_ const int errnum, utf8ness_t * utf8ness)
6436
6440
6437
6441
cur = newlocale (LC_CTYPE_MASK , querylocale_c (LC_MESSAGES ), cur );
6438
6442
errstr = savepv (strerror_l (errnum , cur ));
6439
- * utf8ness = get_locale_string_utf8ness_i (NULL , LC_MESSAGES_INDEX_ ,
6440
- errstr , LOCALE_UTF8NESS_UNKNOWN );
6443
+ * utf8ness = get_locale_string_utf8ness_i (errstr ,
6444
+ LOCALE_UTF8NESS_UNKNOWN ,
6445
+ NULL , LC_MESSAGES_INDEX_ );
6441
6446
freelocale (cur );
6442
6447
}
6443
6448
@@ -6487,8 +6492,9 @@ Perl_my_strerror(pTHX_ const int errnum, utf8ness_t * utf8ness)
6487
6492
const char * errstr ;
6488
6493
if (IN_LC (categories [WHICH_LC_INDEX ])) {
6489
6494
errstr = savepv (Strerror (errnum ));
6490
- * utf8ness = get_locale_string_utf8ness_i (NULL , WHICH_LC_INDEX , errstr ,
6491
- LOCALE_UTF8NESS_UNKNOWN );
6495
+ * utf8ness = get_locale_string_utf8ness_i (errstr ,
6496
+ LOCALE_UTF8NESS_UNKNOWN ,
6497
+ NULL , WHICH_LC_INDEX );
6492
6498
}
6493
6499
else {
6494
6500
@@ -6542,8 +6548,8 @@ Perl_my_strerror(pTHX_ const int errnum, utf8ness_t * utf8ness)
6542
6548
6543
6549
SETLOCALE_UNLOCK ;
6544
6550
6545
- * utf8ness = get_locale_string_utf8ness_i (NULL , LC_MESSAGES_INDEX_ , errstr ,
6546
- LOCALE_UTF8NESS_UNKNOWN );
6551
+ * utf8ness = get_locale_string_utf8ness_i (errstr , LOCALE_UTF8NESS_UNKNOWN ,
6552
+ NULL , LC_MESSAGES_INDEX_ );
6547
6553
DEBUG_STRERROR_RETURN (errstr , utf8ness );
6548
6554
6549
6555
SAVEFREEPV (errstr );
0 commit comments