=item C<YESEXPR>
+=item C<YESSTR>
+
=item C<NOEXPR>
-Only the values for English are returned. Earlier POSIX standards also
-specified C<YESSTR> and C<NOSTR>, but these have been removed from POSIX 2008,
-and aren't supported by C<Perl_langinfo>.
+=item C<NOSTR>
+
+Only the values for English are returned. C<YESSTR> and C<NOSTR> have been
+removed from POSIX 2008, and are retained for backwards compatibility. Your
+platform's C<nl_langinfo> may not support them.
=item C<D_FMT>
LOCALE_UNLOCK;
- return PL_langinfo_buf;
-
# else /* Use nl_langinfo_l(), avoiding both a mutex and changing the locale */
bool do_free = FALSE;
freelocale(cur);
}
+# endif
+
+ if (strEQ(PL_langinfo_buf, "")) {
+ if (item == PERL_YESSTR) {
+ return "yes";
+ }
+ if (item == PERL_NOSTR) {
+ return "no";
+ }
+ }
+
return PL_langinfo_buf;
-# endif
#else /* Below, emulate nl_langinfo as best we can */
# ifdef HAS_LOCALECONV
/* We use only an English set, since we don't know any more */
case PERL_YESEXPR: return "^[+1yY]";
+ case PERL_YESSTR: return "yes";
case PERL_NOEXPR: return "^[-0nN]";
+ case PERL_NOSTR: return "no";
# ifdef HAS_LOCALECONV
#else
# define PERL_YESEXPR -53
#endif
+#ifdef YESSTR
+# define PERL_YESSTR YESSTR
+#else
+# define PERL_YESSTR -54
+#endif
#ifdef NOEXPR
# define PERL_NOEXPR NOEXPR
#else
-# define PERL_NOEXPR -54
+# define PERL_NOEXPR -55
+#endif
+#ifdef NOSTR
+# define PERL_NOSTR NOSTR
+#else
+# define PERL_NOSTR -56
#endif
#ifdef CRNCYSTR
# define PERL_CRNCYSTR CRNCYSTR
#else
-# define PERL_CRNCYSTR -55
+# define PERL_CRNCYSTR -57
#endif
#endif