;; Renamed: 1993/06/03 to tiny-mime.el
;; Renamed: 1995/10/03 from tiny-mime.el (split off encoder)
;; Renamed: 1997/02/22 from tm-ew-d.el
-;; Version: $Revision: 1.7 $
+;; Version: $Revision: 1.8 $
;; Keywords: encoded-word, MIME, multilingual, header, mail, news
;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
;;;
(defconst eword-decode-RCS-ID
- "$Id: eword-decode.el,v 1.7 1998-02-17 13:01:10 morioka Exp $")
+ "$Id: eword-decode.el,v 1.8 1998-02-17 13:10:39 morioka Exp $")
(defconst eword-decode-version (get-version-string eword-decode-RCS-ID))
))))
result))
+(defun eword-decode-and-unfold-structured-field (string)
+ "Decode and unfold STRING as structured field body.
+It decodes non us-ascii characters in FULL-NAME encoded as
+encoded-words or invalid \"raw\" string. \"Raw\" non us-ascii
+characters are regarded as variable `default-mime-charset'.
+
+If an encoded-word is broken or your emacs implementation can not
+decode the charset included in it, it is not decoded."
+ (let ((tokens (eword-lexical-analyze string 'must-unfold))
+ (result ""))
+ (while tokens
+ (let* ((token (car tokens))
+ (type (car token)))
+ (setq tokens (cdr tokens))
+ (setq result
+ (if (eq type 'spaces)
+ (concat result " ")
+ (concat result (eword-decode-token token))
+ ))))
+ result))
+
(defun eword-decode-structured-field-body (string &optional must-unfold
start-column max-column)
"Decode non us-ascii characters in STRING as structured field body.