From: Martin Mares Date: Mon, 25 Jun 2007 18:45:27 +0000 (+0200) Subject: Tell iconv() that we want transliteration. X-Git-Tag: v1.4~26 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=899418e66c7be43ee8d8e6003e58d67e64009fab;p=checkmail.git Tell iconv() that we want transliteration. --- 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); }