From 899418e66c7be43ee8d8e6003e58d67e64009fab Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 25 Jun 2007 20:45:27 +0200 Subject: [PATCH] Tell iconv() that we want transliteration. --- charset.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/charset.c b/charset.c index f9dcac9..921be69 100644 --- a/charset.c +++ b/charset.c @@ -199,7 +199,7 @@ static int rfc2047_decode_word (char *d, const char *s, size_t len) size_t dlen; if (convert_string (d0, strlen(d0), charset, system_charset, &dnew, &dlen) == (size_t) -1) { - debug("Charset conversion failure: <%s> from %s\n", d0, charset); + debug("Charset conversion failure: <%s> from %s (%m)\n", d0, charset); free (charset); free (d0); return (-1); @@ -383,6 +383,13 @@ charset_init(void) system_charset = nl_langinfo(CODESET); if (!system_charset[0]) system_charset = NULL; + if (system_charset) + { + /* FIXME: Use iconvctl() if available? */ + char *t = xmalloc(strlen(system_charset) + 11); + sprintf(t, "%s//TRANSLIT", system_charset); + system_charset = t; + } debug("Charset is %s\n", system_charset); } -- 2.39.5