summaryrefslogtreecommitdiffstats
path: root/unicode/unicode.c
diff options
context:
space:
mode:
Diffstat (limited to 'unicode/unicode.c')
-rw-r--r--unicode/unicode.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/unicode/unicode.c b/unicode/unicode.c
index ab138f6..462ca2b 100644
--- a/unicode/unicode.c
+++ b/unicode/unicode.c
@@ -23,6 +23,7 @@
#endif /* USE_LIBCHARSET */
static char default_chset_buf[32];
+static const char *fix_charset(const char *);
const char *unicode_locale_chset()
{
@@ -33,7 +34,18 @@ const char *unicode_locale_chset()
#else
c=nl_langinfo(CODESET);
#endif
+ return fix_charset(c);
+}
+
+#if HAVE_LANGINFO_L
+const char *unicode_locale_chset_l(locale_t l)
+{
+ return fix_charset(nl_langinfo_l(CODESET, l));
+}
+#endif
+static const char *fix_charset(const char *c)
+{
if (!c)
c="US-ASCII";