nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nmh-workers] show's checkmime


From: Oliver Kiddle
Subject: [Nmh-workers] show's checkmime
Date: Fri, 21 Jan 2005 19:55:19 +0100

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);
        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]