X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=eword-encode.el;h=41bb25f43fe116fd6e3df34b8c3c827882f481f6;hb=0ebff22ece95b526c9a783557828a05d3c954681;hp=2748d713ef9b86caab4386d9f3aab9f84fb910ce;hpb=635edef501f7deb04cdf7e5c327e3c8afd67ca46;p=elisp%2Fflim.git diff --git a/eword-encode.el b/eword-encode.el index 2748d71..41bb25f 100644 --- a/eword-encode.el +++ b/eword-encode.el @@ -31,12 +31,6 @@ (require 'eword-decode) -;;; @ version -;;; - -(defconst eword-encode-version "1.2") - - ;;; @ variables ;;; @@ -119,13 +113,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 +295,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))