From 060d4c6f0a72c5f0aa598fb51c0926e87ef9e1e8 Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Thu, 18 Mar 2010 04:36:35 +0900 Subject: [PATCH] (www-parse-string-as-space-separated-char-list): Expect `string' not to be decoded by `decode-uri-string'. (www-parse-string-as-space-separated-ids): Likewise. (www-feature-parse-string): Likewise. (www-set-display-char-desc): Expect `uri-char' not to be decoded by `decode-uri-string'. (www-set-display-feature-desc): Fix problem when `name@lang' is not existed. (www-batch-set): Don't use `decode-uri-string' for value of `char' and feature-value. --- cwiki-set.el | 49 ++++++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/cwiki-set.el b/cwiki-set.el index 0a92436..9950fd2 100644 --- a/cwiki-set.el +++ b/cwiki-set.el @@ -8,21 +8,22 @@ (defun www-parse-string-as-space-separated-char-list (string) (let (dest char) - (dolist (unit (split-string string " ")) + (dolist (unit (split-string string "\\+")) (if (setq char (www-uri-decode-char unit)) (setq dest (cons char dest)))) (nreverse dest))) (defun www-parse-string-as-space-separated-ids (string) - (ids-parse-string - (let (char) - (mapconcat - (lambda (unit) - (if (setq char (www-uri-decode-char unit)) - (char-to-string char) - unit)) - (split-string string " ") - "")))) + (cdar + (ids-parse-string + (let (char) + (mapconcat + (lambda (unit) + (if (setq char (www-uri-decode-char unit)) + (char-to-string char) + unit)) + (split-string string "\\+") + ""))))) (defun www-parse-string-as-ku-ten (string) (if (string-match "^\\([0-9][0-9]?\\)-\\([0-9][0-9]?\\)" string) @@ -49,8 +50,9 @@ ((eq format 'S-exp) (if (= (length string) 0) nil - (read string))) - (t string))) + (read (decode-uri-string string 'utf-8-mcs-er))) + ) + (t (decode-uri-string string 'utf-8-mcs-er)))) (defun www-set-display-char-desc (uri-char feature value format &optional lang) (when (stringp feature) @@ -64,7 +66,7 @@ (format " CHISE-wiki character: %s \n" - uri-char) + (decode-uri-string uri-char 'utf-8-mcs-er)) 'utf-8-mcs-er)) (princ "\n") (www-html-display-paragraph @@ -108,8 +110,9 @@ (defun www-set-display-feature-desc (feature-name property-name value &optional lang uri-char) (www-html-display-paragraph - (format "set: feature: %S, property-name: %S, value: %S, lang: %S\n" - feature-name property-name value lang)) + (format + "set: feature: %S, property-name: %S, value: %S, lang: %S, char: %S\n" + feature-name property-name value lang uri-char)) (put-char-feature-property feature-name property-name value) (let ((name@lang (intern (format "name@%s" lang))) (uri-feature-name (www-uri-encode-feature-name feature-name))) @@ -141,8 +144,8 @@ >

" name@lang - (or (www-format-encode-string - (char-feature-property feature-name name@lang)) "") + (www-format-encode-string + (or (char-feature-property feature-name name@lang) "")) chise-wiki-edit-url uri-feature-name name@lang))) @@ -205,9 +208,11 @@ (cond ((eq (car ret) 'char) (setq prop (nth 2 target)) (www-set-display-char-desc - (decode-uri-string (cdr ret) 'utf-8-mcs-er) - (cdr (assq 'feature-name target)) - (decode-uri-string (cdr prop) 'utf-8-mcs-er) + (cdr ret) ; (decode-uri-string (cdr ret) 'utf-8-mcs-er) + (intern (decode-uri-string + (cdr (assq 'feature-name target)) + 'utf-8-mcs-er)) + (cdr prop) ; (decode-uri-string (cdr prop) 'utf-8-mcs-er) (car prop) lang) ) @@ -218,7 +223,9 @@ (car prop) (decode-uri-string (cdr prop) 'utf-8-mcs-er) lang - (decode-uri-string (cdr (assq 'char target)))) + (cdr (assq 'char target)) + ;; (decode-uri-string (cdr (assq 'char target))) + ) )) (www-html-display-paragraph (format "%S" target)) -- 1.7.10.4