Update copyright for several files.
[gnus] / lisp / rfc2047.el
index fdce08d..df1fc9b 100644 (file)
@@ -1,5 +1,5 @@
 ;;; rfc2047.el --- Functions for encoding and decoding rfc2047 messages
-;; Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;     MORIOKA Tomohiko <morioka@jaist.ac.jp>
@@ -42,6 +42,7 @@
 
 (defvar rfc2047-header-encoding-alist
   '(("Newsgroups" . nil)
+    ("Followup-To" . nil)
     ("Message-ID" . nil)
     ("\\(Resent-\\)?\\(From\\|Cc\\|To\\|Bcc\\|Reply-To\\|Sender\\)" .
      "-A-Za-z0-9!*+/=_")
@@ -538,7 +539,7 @@ The buffer may be narrowed."
                   mail-parse-charset
                   (not (eq mail-parse-charset 'us-ascii))
                   (not (eq mail-parse-charset 'gnus-decoded)))
-         (mm-decode-coding-region b (point-max) mail-parse-charset))))))
+         (mm-decode-coding-region-safely b (point-max) mail-parse-charset))))))
 
 (defun rfc2047-decode-string (string)
   "Decode the quoted-printable-encoded STRING and return the results."
@@ -555,7 +556,12 @@ The buffer may be narrowed."
               mail-parse-charset
               (not (eq mail-parse-charset 'us-ascii))
               (not (eq mail-parse-charset 'gnus-decoded)))
-         (mm-decode-coding-string string mail-parse-charset)
+         (let* ((decoded (mm-decode-coding-string string mail-parse-charset))
+                (charsets (find-charset-string decoded)))
+           (if (or (memq 'eight-bit-control charsets)
+                   (memq 'eight-bit-graphic charsets))
+               (mm-decode-coding-string string 'undecided)
+             decoded))
        string))))
 
 (defun rfc2047-parse-and-decode (word)