This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add information to warning msgs
authorKarl Williamson <khw@cpan.org>
Thu, 15 Feb 2018 05:43:51 +0000 (22:43 -0700)
committerKarl Williamson <khw@cpan.org>
Sun, 18 Feb 2018 18:20:32 +0000 (11:20 -0700)
If we have nl_langinfo, this adds the codeset it returns to the messages
generated when there are anomalies in locales that are coming into
effect

locale.c

index f163976..30d0ec8 100644 (file)
--- a/locale.c
+++ b/locale.c
@@ -823,6 +823,14 @@ S_new_ctype(pTHX_ const char *newctype)
                             );
             }
 
+#  ifdef HAS_NL_LANGINFO
+
+            Perl_sv_catpvf(aTHX_ PL_warn_locale, "; codeset=%s",
+                                    /* parameter FALSE is a don't care here */
+                                    my_nl_langinfo(PERL_CODESET, FALSE));
+
+#  endif
+
             Perl_sv_catpvf(aTHX_ PL_warn_locale, "\n");
 
             /* If we are actually in the scope of the locale or are debugging,