Function: package--encode
package--encode is a byte-compiled function defined in
package-x.el.gz.
Signature
(package--encode STRING)
Documentation
Encode a string by replacing some characters with XML entities.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/package-x.el.gz
(defun package--encode (string)
"Encode a string by replacing some characters with XML entities."
;; We need a special case for translating "&" to "&".
(let ((index))
(while (setq index (string-match "[&]" string index))
(setq string (replace-match "&" t nil string))
(setq index (1+ index))))
(while (string-match "[<]" string)
(setq string (replace-match "<" t nil string)))
(while (string-match "[>]" string)
(setq string (replace-match ">" t nil string)))
(while (string-match "[']" string)
(setq string (replace-match "'" t nil string)))
(while (string-match "[\"]" string)
(setq string (replace-match """ t nil string)))
string)