(www-uri-encode-object): Renamed from `www-uri-encode-char'.
authorMORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
Tue, 16 Nov 2010 07:33:29 +0000 (16:33 +0900)
committerMORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
Tue, 16 Nov 2010 07:33:29 +0000 (16:33 +0900)
(www-format-value-as-char-list): Use `www-uri-encode-object' instead
of `www-uri-encode-char'.
(www-format-value-as-ids): Likewise.
(www-format-eval-unit): Likewise.

cwiki-common.el

index 53749f9..bf0e9e7 100644 (file)
         '=id (car (read-from-string char-rep)) genre)
        ))))))
 
-(defun www-uri-encode-char (char)
-  (if (characterp char)
-      (if (encode-char char '=ucs)
+(defun www-uri-encode-object (object)
+  (if (characterp object)
+      (if (encode-char object '=ucs)
          (mapconcat
           (lambda (byte)
             (format "%%%02X" byte))
-          (encode-coding-string (char-to-string char) 'utf-8-mcs-er)
+          (encode-coding-string (char-to-string object) 'utf-8-mcs-er)
           "")
        (let ((ccs-list '(; =ucs
                          =cns11643-1 =cns11643-2 =cns11643-3
              ccs ret)
          (while (and ccs-list
                      (setq ccs (pop ccs-list))
-                     (not (setq ret (encode-char char ccs 'defined-only)))))
+                     (not (setq ret (encode-char object ccs 'defined-only)))))
          (cond (ret
                 (format "%s:0x%X"
                         (www-uri-encode-feature-name ccs)
                         ret))
-               ((and (setq ccs (car (split-char char)))
-                     (setq ret (encode-char char ccs)))
+               ((and (setq ccs (car (split-char object)))
+                     (setq ret (encode-char object ccs)))
                 (format "%s:0x%X"
                         (www-uri-encode-feature-name ccs)
                         ret))
                (t
                 (format "system-char-id:0x%X"
-                        (encode-char char 'system-char-id))
+                        (encode-char object 'system-char-id))
                 ))))
-    (format "rep.id:%s" (concord-object-id char))))
+    (format "rep.id:%s" (concord-object-id object))))
 
 (defun est-format-object (object)
   (if (characterp object)
             (if (characterp unit)
                 (format "<a href=\"%s?char=%s\">%s</a>"
                         chise-wiki-view-url
-                        (www-uri-encode-char unit)
+                        (www-uri-encode-object unit)
                         (www-format-encode-string (char-to-string unit)))
               (format "<a href=\"%s?%s=%s\">%s</a>"
                       chise-wiki-view-url
           (if (characterp unit)
               (format "<a href=\"%s?char=%s\">%s</a>"
                       chise-wiki-view-url
-                      (www-uri-encode-char unit)
+                      (www-uri-encode-object unit)
                       (www-format-encode-string (char-to-string unit)))
             (www-format-encode-string (format "%s" unit)))))
        (ideographic-structure-to-ids value) " ")
   (unless value
     (setq value (www-get-feature-value object feature-name)))
   (unless uri-object
-    (setq uri-object (www-uri-encode-char object)))
+    (setq uri-object (www-uri-encode-object object)))
   (cond
    ((stringp exp) (www-format-encode-string exp))
    ((null exp) "")
          (if prev-char
              (format "\n<a href=\"%s?char=%s\">%s</a>"
                      chise-wiki-view-url
-                     (www-uri-encode-char prev-char)
+                     (www-uri-encode-object prev-char)
                       "<input type=\"submit\" value=\"-\" />"
                      ;; (www-format-encode-string
                       ;;  (char-to-string prev-char))
          (if next-char
              (format "<a href=\"%s?char=%s\">%s</a>"
                      chise-wiki-view-url
-                     (www-uri-encode-char next-char)
+                     (www-uri-encode-object next-char)
                       "<input type=\"submit\" value=\"+\" />"
                      ;; (www-format-encode-string
                       ;;  (char-to-string next-char))