Function: article-de-base64-unreadable

article-de-base64-unreadable is an interactive and byte-compiled function defined in gnus-art.el.gz.

Signature

(article-de-base64-unreadable &optional FORCE READ-CHARSET)

Documentation

Translate a base64 article.

If FORCE, decode the article whether it is marked as base64 not. If READ-CHARSET, ask for a coding system.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-art.el.gz
(defun article-de-base64-unreadable (&optional force read-charset)
  "Translate a base64 article.
If FORCE, decode the article whether it is marked as base64 not.
If READ-CHARSET, ask for a coding system."
  (interactive (list 'force current-prefix-arg) gnus-article-mode)
  (save-excursion
    (let ((inhibit-read-only t) type charset)
      (if (gnus-buffer-live-p gnus-original-article-buffer)
	  (with-current-buffer gnus-original-article-buffer
	    (setq type
		  (gnus-fetch-field "content-transfer-encoding"))
	    (let* ((ct (gnus-fetch-field "content-type"))
		   (ctl (and ct (mail-header-parse-content-type ct))))
	      (setq charset (and ctl
				 (mail-content-type-get ctl 'charset)))
	      (if (stringp charset)
		  (setq charset (intern (downcase charset)))))))
      (if read-charset
	  (setq charset (read-coding-system "Charset: " charset)))
      (unless charset
	(setq charset gnus-newsgroup-charset))
      (when (or force
		(and type (let ((case-fold-search t))
			    (string-match "base64" type))))
	(article-goto-body)
	(save-restriction
	  (narrow-to-region (point) (point-max))
	  (base64-decode-region (point-min) (point-max))
	  (decode-coding-region
	   (point-min) (point-max)
	   (mm-charset-to-coding-system charset nil t)))))))