]> mj.ucw.cz Git - checkmail.git/commitdiff
Tell iconv() that we want transliteration.
authorMartin Mares <mj@ucw.cz>
Mon, 25 Jun 2007 18:45:27 +0000 (20:45 +0200)
committerMartin Mares <mj@ucw.cz>
Mon, 25 Jun 2007 18:45:27 +0000 (20:45 +0200)
charset.c

index f9dcac9554104dfe7b5c9ebfce15d25c5a17dd03..921be697c528af615c7dffadf2c16548b34a55d6 100644 (file)
--- 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);
 }