From: morioka Date: Fri, 17 Apr 1998 02:27:33 +0000 (+0000) Subject: (eword-encode-divide-into-charset-words): Use 'char-length or X-Git-Tag: flim-1_0_1~7 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=71871d197c265b21132ffefbda8d6b83cfb850c6;p=elisp%2Fflim.git (eword-encode-divide-into-charset-words): Use 'char-length or 'char-next-index instead of 'char-bytes. (tm-eword::encode-string-1): Use 'char-next-index instead of 'char-bytes. --- diff --git a/eword-encode.el b/eword-encode.el index 2748d71..2a38ee3 100644 --- a/eword-encode.el +++ b/eword-encode.el @@ -119,13 +119,12 @@ MODE is allows `text', `comment', `phrase' or nil. Default value is (while (> len 0) (let* ((chr (sref string 0)) (charset (eword-encode-char-type chr)) - (i (char-bytes chr)) - ) + (i (char-length chr))) (while (and (< i len) (setq chr (sref string i)) (eq charset (eword-encode-char-type chr)) ) - (setq i (+ i (char-bytes chr))) + (setq i (char-next-index chr i)) ) (setq dest (cons (cons charset (substring string 0 i)) dest) string (substring string i) @@ -302,7 +301,7 @@ MODE is allows `text', `comment', `phrase' or nil. Default value is (str "") nstr) (while (and (< p len) (progn - (setq np (+ p (char-bytes (sref string p)))) + (setq np (char-next-index (sref string p) p)) (setq nstr (substring string 0 np)) (setq ret (tm-eword::encoded-word-length (cons nstr (cdr rword))