Function: mail-quote-printable-region

mail-quote-printable-region is an autoloaded, interactive and byte-compiled function defined in mail-utils.el.gz.

Signature

(mail-quote-printable-region BEG END &optional WRAPPER)

Documentation

Convert the region to the "quoted printable" Q encoding.

If the optional argument WRAPPER is non-nil, we add the wrapper characters =?ISO-8859-1?Q?....?=.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/mail/mail-utils.el.gz
;;;###autoload
(defun mail-quote-printable-region (beg end &optional wrapper)
  "Convert the region to the \"quoted printable\" Q encoding.
If the optional argument WRAPPER is non-nil,
we add the wrapper characters =?ISO-8859-1?Q?....?=."
  (interactive "r\nP")
  (save-match-data
    (save-excursion
      (goto-char beg)
      (save-restriction
	(narrow-to-region beg end)
	(while (re-search-forward "[?=\"\200-\377]" nil t)
	  (replace-match (upcase (format "=%02x" (preceding-char)))
			 t t))
	(when wrapper
	  (goto-char beg)
	  (insert "=?ISO-8859-1?Q?")
	  (goto-char end)
	  (insert "?="))))))