Silly of me to overlook it: another obvious way you might like to
[sgt/charset] / mimeenc.c
index e0ace12..ac8c9a4 100644 (file)
--- a/mimeenc.c
+++ b/mimeenc.c
@@ -176,6 +176,11 @@ static const struct {
     { "850", CS_CP850 },
     { "csPC850Multilingual", CS_CP850 },
 
+    { "IBM852", CS_CP852 },
+    { "cp852", CS_CP852 },
+    { "852", CS_CP852 },
+    { "csIBM852", CS_CP852 },
+
     { "IBM866", CS_CP866 },
     { "cp866", CS_CP866 },
     { "866", CS_CP866 },
@@ -272,6 +277,7 @@ static const struct {
     { "Shift_JIS", CS_SHIFT_JIS },
     { "MS_Kanji", CS_SHIFT_JIS },
     { "csShiftJIS", CS_SHIFT_JIS },
+    { "x-sjis", CS_SHIFT_JIS },               /* WILD */
 
     { "HZ-GB-2312", CS_HZ },
 
@@ -323,7 +329,7 @@ int charset_from_mimeenc(const char *name)
        p = name;
        q = mimeencs[i].name;
        while (*p || *q) {
-           if (tolower(*p) != tolower(*q))
+               if (tolower((unsigned char)*p) != tolower((unsigned char)*q))
                break;
            p++; q++;
        }