Function: mm-url-form-encode-xwfu

mm-url-form-encode-xwfu is a byte-compiled function defined in mm-url.el.gz.

Signature

(mm-url-form-encode-xwfu CHUNK)

Documentation

Escape characters in a string for application/x-www-form-urlencoded.

Blasphemous crap because someone didn't think %20 was good enough for encoding spaces. Die Die Die.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/mm-url.el.gz
(defun mm-url-form-encode-xwfu (chunk)
  "Escape characters in a string for application/x-www-form-urlencoded.
Blasphemous crap because someone didn't think %20 was good enough for encoding
spaces.  Die Die Die."
  ;; This will get rid of the 'attributes' specified by the file type,
  ;; which are useless for an application/x-www-form-urlencoded form.
  (if (consp chunk)
      (setq chunk (cdr chunk)))

  (if chunk
      (mapconcat
       (lambda (char)
	 (cond
	  ((= char ?  ) "+")
	  ((memq char mm-url-unreserved-chars) (char-to-string char))
	  (t (upcase (format "%%%02x" char)))))
       (encode-coding-string chunk (car (find-coding-systems-string chunk)))
       "")))