File nail-11.25-ttychar.dif of Package mailx

--- mime.c
+++ mime.c	2005-10-14 14:28:39.000000000 +0000
@@ -261,7 +261,19 @@ getcharset(int isclean)
 		charset = (wantcharset && wantcharset != (char *)-1) ?
 			wantcharset : value("charset");
 		if (charset == NULL) {
-			charset = defcharset;
+			char *t = value("ttycharset");
+			if (t == NULL || (ascncasecmp("ANSI_X3.4", t, 9) == 0))
+				charset = defcharset;
+			else {
+				int c;
+				char *ptr;
+
+				ptr = charset = sstrdup(t);
+				while ((c = *ptr)) {
+					*ptr = lowerconv(c & 0377);
+					ptr++;
+				}
+			}
 		}
 	} else {
 		/*