nmh-workers
[Top] [All Lists]

[Nmh-workers] show's checkmime

2005-01-21 12:04:37
On a new Linux installation, I have a UTF-8 locale enabled by default.
For this reason, I set MM_CHARSET to UTF-8. Recently, I noticed that
show invokes mhshow for messages with:
  Content-Type: text/plain; charset="us-ascii"
whereas that doesn't occur for ISO-8859-1.

UTF-8 is just as compatible with plain 7bit ASCII so I'll make the
change in the attached patch.

Shouldn't the code somehow be using nl_langinfo(CODESET) instead of the
MM_CHARSET environment variable?

Oliver

Index: sbr/check_charset.c
===================================================================
RCS file: /cvsroot/nmh/nmh/sbr/check_charset.c,v
retrieving revision 1.2
diff -u -r1.2 check_charset.c
--- sbr/check_charset.c 2 Jul 2002 22:09:14 -0000       1.2
+++ sbr/check_charset.c 21 Jan 2005 18:33:40 -0000
@@ -32,8 +32,9 @@
            mm_charset = "US-ASCII";
        mm_len = strlen (mm_charset);
 
-       /* US-ASCII is a subset of the ISO-8859-X character sets */
-       if (!strncasecmp("ISO-8859-", mm_charset, 9)) {
+       /* US-ASCII is a subset of the ISO-8859-X and UTF-8 character sets */
+       if (!strncasecmp("ISO-8859-", mm_charset, 9) ||
+               !strncasecmp("UTF-8", mm_charset, 5)) {
            alt_charset = "US-ASCII";
            alt_len = strlen (alt_charset);
        }


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

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