diff --git a/locale.c b/locale.c index 11465bdf5b09..718312d10a35 100644 --- a/locale.c +++ b/locale.c @@ -1347,7 +1347,15 @@ S_emulate_setlocale_i(pTHX_ line, new_obj)); #ifdef MULTIPLICITY - PL_cur_locale_obj = new_obj; + + if (PL_cur_locale_obj != new_obj) { + DEBUG_Lv(PerlIO_printf(Perl_debug_log, + "(%" LINE_Tf "): PL_cur_locale_obj was %p\n", line, PL_cur_locale_obj)); + PL_cur_locale_obj = new_obj; + DEBUG_Lv(PerlIO_printf(Perl_debug_log, + "(%" LINE_Tf "): PL_cur_locale_obj now %p\n", line, PL_cur_locale_obj)); + } + #endif /* We are done, except for updating our records (if the system doesn't keep @@ -1422,6 +1430,10 @@ S_stdize_locale(pTHX_ const int category, PERL_ARGS_ASSERT_STDIZE_LOCALE; + DEBUG_Lv(PerlIO_printf(Perl_debug_log, + "(%" LINE_Tf "): Entering stdize_locale(%d, '%s')\n", + caller_line, category, input_locale)); + if (input_locale == NULL) { return NULL; } @@ -2910,6 +2922,12 @@ S_get_locale_string_utf8ness_i(pTHX_ const char * string, * use the current locale for the category specified by 'cat_index'. */ + DEBUG_Lv(PerlIO_printf(Perl_debug_log, + "Entering get_locale_string_utf8ness_i; locale=%s," + " index=%u(%s), string=%s, known_utf8=%d\n", + locale, cat_index, category_names[cat_index], + _byte_dump_string((U8 *) string, strlen(string), 0), + known_utf8)); if (string == NULL) { return UTF8NESS_NO; }