X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=blobdiff_plain;f=lisp%2Frfc2047.el;h=a85f6a5fcaf348ef2026e4ab9482a540571237d7;hp=81241c2d0185affa19bc2a9845b4fd9f0544861d;hb=40d0440ae3769803fb4897a445f49e345ed81c3b;hpb=c75e2d4e13ec2850b049cf5d27ad941d5192b3ac diff --git a/lisp/rfc2047.el b/lisp/rfc2047.el index 81241c2d0..a85f6a5fc 100644 --- a/lisp/rfc2047.el +++ b/lisp/rfc2047.el @@ -184,10 +184,7 @@ Should be called narrowed to the head of the message." (downcase (symbol-name encoding)) "?"))) (save-restriction (narrow-to-region b e) - (insert - (prog1 - (mm-encode-coding-string (buffer-string) mime-charset) - (delete-region (point-min) (point-max)))) + (mm-encode-coding-region b e mime-charset) (funcall (cdr (assq encoding rfc2047-encoding-function-alist)) (point-min) (point-max)) (goto-char (point-min)) @@ -249,6 +246,7 @@ Should be called narrowed to the head of the message." (defun rfc2047-decode-string (string) "Decode the quoted-printable-encoded STRING and return the results." (with-temp-buffer + (mm-enable-multibyte) (insert string) (inline (rfc2047-decode-region (point-min) (point-max))) @@ -269,7 +267,7 @@ Return WORD if not." word))) (defun rfc2047-decode (charset encoding string) - "Decode STRING as an encoded text. + "Decode STRING that uses CHARSET with ENCODING. Valid ENCODINGs are \"B\" and \"Q\". If your Emacs implementation can't decode CHARSET, it returns nil." (let ((cs (mm-charset-to-coding-system charset)))