No more mhshow-charset-* but instead automatic invocation of iconv(1).
[mmh] / uip / mhparse.c
index cf264c6..dc8e380 100644 (file)
@@ -963,9 +963,7 @@ InitGeneric(CT ct)
 static int
 InitText(CT ct)
 {
-       char buffer[BUFSIZ];
-       char *chset = NULL;
-       char **ap, **ep, *cp;
+       char **ap, **ep;
        struct k2v *kv;
        struct text *t;
        CI ci = &ct->c_ctinfo;
@@ -992,10 +990,11 @@ InitText(CT ct)
 
        /* check if content specified a character set */
        if (*ap) {
+               /* store its name */
+               ct->c_charset = getcpy(norm_charmap(*ep));
                /* match character set or set to CHARSET_UNKNOWN */
                for (kv = Charset; kv->kv_key; kv++) {
                        if (!mh_strcasecmp(*ep, kv->kv_key)) {
-                               chset = *ep;
                                break;
                        }
                }
@@ -1004,20 +1003,6 @@ InitText(CT ct)
                t->tx_charset = CHARSET_UNSPECIFIED;
        }
 
-       /*
-       ** If we can not handle character set natively,
-       ** then check profile for string to modify the
-       ** terminal or display method.
-       **
-       ** termproc is for mhshow, though mhlist -debug prints it, too.
-       */
-       if (chset != NULL && !check_charset(chset, strlen(chset))) {
-               snprintf(buffer, sizeof(buffer), "%s-charset-%s",
-                               invo_name, chset);
-               if ((cp = context_find(buffer)))
-                       ct->c_termproc = getcpy(cp);
-       }
-
        return OK;
 }