summaryrefslogtreecommitdiffstats
path: root/unicode/unicode.c
diff options
context:
space:
mode:
authorSam Varshavchik2015-07-31 08:30:25 -0400
committerSam Varshavchik2015-07-31 08:30:25 -0400
commit84dd6e55bc0069a816d303e51e1f237a36b0c7a5 (patch)
treedde23184f469a31a49812771f1a6a0e3563e6386 /unicode/unicode.c
parent228f4c614680f27acceb807074857c01c753e100 (diff)
downloadcourier-libs-84dd6e55bc0069a816d303e51e1f237a36b0c7a5.tar.bz2
Implement unicode_locale_chset_l()
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";