I've just seen the MIME charset name 'x-sjis' in the wild. Add it to
[sgt/charset] / mimeenc.c
index 38b76e5..b193374 100644 (file)
--- a/mimeenc.c
+++ b/mimeenc.c
@@ -181,6 +181,8 @@ static const struct {
     { "866", CS_CP866 },
     { "csIBM866", CS_CP866 },
 
+    { "windows-874", CS_CP874 },       /* WILD */
+
     { "windows-1250", CS_CP1250 },
     { "win-1250", CS_CP1250 },        /* WILD */
 
@@ -270,6 +272,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 },
 
@@ -321,7 +324,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++;
        }