;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc.
;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Version: $Revision: 0.20 $
+;; Version: $Revision: 0.21 $
;; Keywords: encoded-word, MIME, multilingual, header, mail, news
;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
;;;
(defconst eword-encode-RCS-ID
- "$Id: eword-encode.el,v 0.20 1997-06-21 14:25:21 morioka Exp $")
+ "$Id: eword-encode.el,v 0.21 1997-06-21 14:39:38 morioka Exp $")
(defconst eword-encode-version (get-version-string eword-encode-RCS-ID))
(char-charset character)
))
-(defun tm-eword::split-to-lc-words (str)
- (let (ret dest)
- (while (not (string= str ""))
- (let* ((chr (sref str 0))
+(defun eword-encode-divide-into-charset-words (string)
+ (let ((len (length string))
+ dest)
+ (while (> len 0)
+ (let* ((chr (sref string 0))
(charset (eword-encode-char-type chr))
(i (char-bytes chr))
- (len (length str))
)
(while (and (< i len)
- (setq chr (sref str i))
+ (setq chr (sref string i))
(eq charset (eword-encode-char-type chr))
)
(setq i (+ i (char-bytes chr)))
)
- (setq dest (cons (cons charset (substring str 0 i)) dest)
- str (substring str i))
- ))
- (reverse dest)
+ (setq dest (cons (cons charset (substring string 0 i)) dest)
+ string (substring string i)
+ len (- len i)
+ )))
+ (nreverse dest)
))
(defun tm-eword::split-string (str &optional mode)
(tm-eword::space-process
- (tm-eword::words-to-ruled-words (tm-eword::lc-words-to-words
- (tm-eword::split-to-lc-words str))
- mode)))
+ (tm-eword::words-to-ruled-words
+ (tm-eword::lc-words-to-words
+ (eword-encode-divide-into-charset-words str))
+ mode)))
;;; @ length
'(("(" nil nil))
(tm-eword::words-to-ruled-words
(tm-eword::lc-words-to-words
- (tm-eword::split-to-lc-words (cdr token)))
+ (eword-encode-divide-into-charset-words
+ (cdr token)))
'comment)
'((")" nil nil))
))
)
(t
- (setq dest (append dest
- (tm-eword::words-to-ruled-words
- (tm-eword::lc-words-to-words
- (tm-eword::split-to-lc-words (cdr token))
- ) 'phrase)))
+ (setq dest
+ (append dest
+ (tm-eword::words-to-ruled-words
+ (tm-eword::lc-words-to-words
+ (eword-encode-divide-into-charset-words
+ (cdr token))
+ ) 'phrase)))
))
(setq phrase (cdr phrase))
)