nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] charset conversion for windows-1252

2013-10-27 16:52:51
Thanks for tracking that down. Would it be possible to roll out a
1.5.1 which contains that patch?

Sigh.  I kinda lack the energy to do that.  It's not worth it for me
just to do that for one bug, and tracking down other bugs (there is a
not-insigificant number) to cherry-pick for a 1.5.1 is more effort than
I want to expend on it (others are free to do so, of course).  If you
just want to apply that one patch, it should apply with only a little
bit of fuzz (appended below).

--Ken

---
 h/mhparse.h      |    4 +---
 uip/mhbuildsbr.c |    3 +--
 uip/mhparse.c    |   16 +++-------------
 3 files changed, 5 insertions(+), 18 deletions(-)

diff --git a/h/mhparse.h b/h/mhparse.h
index 48f221f..5a5a219 100644
--- a/h/mhparse.h
+++ b/h/mhparse.h
@@ -162,10 +162,8 @@ struct Content {
 #define TEXT_ENRICHED  0x03
 
 /* Flags for character sets */
-#define        CHARSET_UNKNOWN     0x00
+#define        CHARSET_SPECIFIED    0x00
 #define CHARSET_UNSPECIFIED 0x01  /* only needed when building drafts */
-#define        CHARSET_USASCII     0x01
-#define        CHARSET_LATIN       0x02
 
 /* Structure for text content */
 struct text {
diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c
index 0ebdaba..6a7443e 100644
--- a/uip/mhbuildsbr.c
+++ b/uip/mhbuildsbr.c
@@ -1358,12 +1358,11 @@ scan_content (CT ct)
                continue;
 
            if (contains8bit) {
-               t->tx_charset = CHARSET_UNKNOWN;
                *ap = concat ("charset=", write_charset_8bit(), NULL);
            } else {
-               t->tx_charset = CHARSET_USASCII;
                *ap = add ("charset=us-ascii", NULL);
            }
+           t->tx_charset = CHARSET_SPECIFIED;
 
            cp = strchr(*ap++, '=');
            *ap = NULL;
diff --git a/uip/mhparse.c b/uip/mhparse.c
index 25bbad7..8cfa899 100644
--- a/uip/mhparse.c
+++ b/uip/mhparse.c
@@ -46,11 +46,7 @@ struct k2v SubText[] = {
     { NULL,       TEXT_UNKNOWN }    /* this one must be last! */
 };
 
-struct k2v Charset[] = {
-    { "us-ascii",   CHARSET_USASCII },
-    { "iso-8859-1", CHARSET_LATIN },
-    { NULL,         CHARSET_UNKNOWN }  /* this one must be last! */
-};
+/* Charset[] removed -- yozo.  Mon Oct  8 01:03:41 JST 2012 */
 
 /*
  * Structures for MULTIPART messages
@@ -1077,14 +1073,8 @@ InitText (CT ct)
 
     /* check if content specified a character set */
     if (*ap) {
-       /* 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;
-           }
-       }
-       t->tx_charset = kv->kv_value;
+       chset = *ep;
+       t->tx_charset = CHARSET_SPECIFIED;
     } else {
        t->tx_charset = CHARSET_UNSPECIFIED;
     }
-- 
1.7.9


_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>