A real fix.
authorShengHuo ZHU <zsh@cs.rochester.edu>
Sun, 6 Jan 2002 01:47:41 +0000 (01:47 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Sun, 6 Jan 2002 01:47:41 +0000 (01:47 +0000)
(rfc2047-decode-string): Decode it.

lisp/ChangeLog
lisp/rfc2047.el

index 500757b..e7e322e 100644 (file)
@@ -6,7 +6,7 @@
        is no quoted-printable-encoded STRING.
        From: Jesper Harder <harder@ifa.au.dk>
        
-       (rfc2047-decode-string): Return unibyte string.
+       (rfc2047-decode-string): Decode it.
 
 2002-01-05  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
index e57954e..948e168 100644 (file)
@@ -534,16 +534,21 @@ The buffer may be narrowed."
 
 (defun rfc2047-decode-string (string)
   "Decode the quoted-printable-encoded STRING and return the results."
-  (if (string-match "=\\?" string)
-      (let ((m (mm-multibyte-p)))
+  (let ((m (mm-multibyte-p)))
+    (if (string-match "=\\?" string)
        (with-temp-buffer
          (when m
            (mm-enable-multibyte))
          (insert string)
          (inline
            (rfc2047-decode-region (point-min) (point-max)))
-         (buffer-string)))
-    (mm-string-as-unibyte string)))
+         (buffer-string))
+      (if (and m 
+              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)
+       string))))
 
 (defun rfc2047-parse-and-decode (word)
   "Decode WORD and return it if it is an encoded word.