(eval-and-compile
(eval
'(unless (fboundp 'base64-decode-string)
- (autoload 'base64-decode-string "base64")
- (autoload 'base64-encode-region "base64" nil t))))
+ (require 'base64))))
+
(require 'qp)
(require 'mm-util)
(require 'ietf-drums)
(iso-8859-3 . Q)
(iso-8859-4 . Q)
(iso-8859-5 . B)
- (koi8-r . Q)
+ (koi8-r . B)
(iso-8859-7 . Q)
(iso-8859-8 . Q)
(iso-8859-9 . Q)
(rfc2047-encode-region (point-min) (point-max)))
;; Hm.
(t))))
- (goto-char (point-max))))))))
+ (goto-char (point-max)))))
+ (when rfc2047-default-charset
+ (encode-coding-region (point-min) (point-max)
+ rfc2047-default-charset)))))
(defun rfc2047-encodable-p ()
"Say whether the current (narrowed) buffer contains characters that need encoding."
(goto-char (point-min))
(while (not (eobp))
(goto-char (min (point-max) (+ 64 (point))))
- (search-backward "=" nil (- (point) 2))
+ (search-backward "=" (- (point) 2) t)
(unless (eobp)
(insert "\n")))))))
If your Emacs implementation can't decode CHARSET, it returns nil."
(let ((cs (mm-charset-to-coding-system charset)))
(when cs
+ (when (eq cs 'ascii)
+ (setq cs rfc2047-default-charset))
(mm-decode-coding-string
(cond
((equal "B" encoding)