Function: rfc1843-decode

rfc1843-decode is a byte-compiled function defined in rfc1843.el.gz.

Signature

(rfc1843-decode WORD &optional FIRSTC)

Documentation

Decode HZ WORD and return it.

Source Code

;; Defined in /usr/src/emacs/lisp/international/rfc1843.el.gz
(defun rfc1843-decode (word &optional firstc)
  "Decode HZ WORD and return it."
  (let ((i -1) (s (substring word 0)) v)
    (if (or (not firstc) (eq firstc ?{))
        (while (< (incf i) (length s))
	  (if (eq (setq v (aref s i)) ? ) nil
	    (aset s i (+ 128 v))))
      (while (< (incf i) (length s))
	(if (eq (setq v (aref s i)) ? ) nil
	  (setq v (+ (* 94 v) (aref s (1+ i)) -3135))
	  (aset s i (+ (/ v 157) (if (eq firstc ?<) 201 161)))
	  (setq v (% v 157))
          (aset s (incf i) (+ v (if (< v 63) 64 98))))))
    s))