3 (defun decode-url-string (string &optional coding-system)
4 (if (> (length string) 0)
7 (while (string-match "%\\([0-9A-F][0-9A-F]\\)" string i)
8 (setq dest (concat dest
9 (substring string i (match-beginning 0))
12 (string-to-int (match-string 1 string) 16))))
15 (concat dest (substring string i))
18 (defvar www-ids-find-tang-chars-file-name
19 "~tomo/projects/chise/ids/www/tang-chars.udd")
21 (defun www-batch-ids-find ()
22 (let ((components (car command-line-args-left))
23 (coded-charset-entity-reference-alist
26 (=jef-china3 "JC3-" 4 X))
27 coded-charset-entity-reference-alist))
29 (setq command-line-args-left (cdr command-line-args-left))
32 (if (string-match "^components=" components)
33 (setq components (substring components (match-end 0))))
35 (if (> (length components) 0)
36 (decode-url-string components 'utf-8-jp-er)
42 (princ "Content-Type: text/html; charset=\"UTF-8\"
44 <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
45 \"http://www.w3.org/TR/html4/loose.dtd\">
48 <title>CHISE IDS Find</title>
54 (princ (encode-coding-string "CHISE IDS
\e$B4A;z8!:w
\e(B" 'utf-8-jp-er))
57 <form action=\"http://mousai.kanji.zinbun.kyoto-u.ac.jp/ids-find\" method=\"GET\">
59 (princ (encode-coding-string "
\e$BItIJJ8;zNs
\e(B" 'utf-8-jp-er))
60 (princ " <input type=\"text\" name=\"components\" size=\"30\" maxlength=\"30\" value=\"")
61 (if (> (length components) 0)
62 (princ (encode-coding-string components 'utf-8-jp-er)))
64 <input type=\"submit\" value=\"")
65 (princ (encode-coding-string "
\e$B8!:w3+;O
\e(B" 'utf-8-jp-er))
72 ;; (map-char-attribute
74 ;; (when (every (lambda (p)
75 ;; (ideographic-structure-member p v))
77 ;; (princ (encode-coding-string
78 ;; (ids-find-format-line c v)
83 ;; 'ideographic-structure)
84 (dolist (c (ideographic-products-find components))
85 (setq is (char-feature c 'ideographic-structure))
86 ;; to avoid problems caused by wrong indexes
87 (when (every (lambda (c)
88 (ideographic-structure-member c is))
91 (encode-coding-string (format "%c" c) 'utf-8-jp-er))
93 ((string-match "&CB\\([0-9]+\\);" str)
94 (setq code (string-to-int (match-string 1 str)))
95 (princ (format "<img alt=\"CB%05d\" src=\"http://mousai.kanji.zinbun.kyoto-u.ac.jp/glyphs/cb-gaiji/%02d/CB%05d.gif\">\n"
96 code (/ code 1000) code))
97 (princ (format "CB%05d" code))
102 (or (if (setq ucs (or (char-ucs c)
103 (encode-char c 'ucs)))
104 (format " <a href=\"http://www.unicode.org/cgi-bin/GetUnihanData.pl?codepoint=%X\">%s</a>"
106 (cond ((<= ucs #xFFFF)
107 (format "U+%04X" ucs))
109 (format "U-%08X" ucs))))
115 (encode-coding-string
116 (ideographic-structure-to-ids is)
118 (goto-char (point-min))
119 (while (re-search-forward "&CB\\([0-9]+\\);" nil t)
120 (setq code (string-to-int (match-string 1)))
122 (format "<img alt=\"CB%05d\" src=\"http://mousai.kanji.zinbun.kyoto-u.ac.jp/glyphs/cb-gaiji/%02d/CB%05d.gif\">"
123 code (/ code 1000) code)
129 www-ids-find-tang-chars-file-name)
130 (goto-char (point-min))
131 (re-search-forward (format "^%d$" ucs) nil t)))
133 (format " <a href=\"http://coe21.zinbun.kyoto-u.ac.jp/djvuchar?query=%s\">"
136 (format "%%%02X" (char-int c)))
137 (encode-coding-string (char-to-string c)
140 (princ (encode-coding-string "
\e$B"M
\e(B[
\e$BEbBeBsK\
\e(B]</a>" 'utf-8-jp-er)))
145 (princ (encode-coding-string "<hr>
147 \e$B;XDj$7$?ItIJ$rA4$F4^$`4A;z$N0lMw$rI=<($7$^$9!#
\e(B
149 CHISE
\e$B$GMQ$$$i$l$k<BBV;2>H7A<0!JNc!'
\e(B&M-00003;
\e$B!K$GItIJ$r;XDj$9$k;v$b$G$-$^$9!#
\e(B" 'utf-8-jp-er))
155 href=\"http://kanji.zinbun.kyoto-u.ac.jp/projects/chise/xemacs/\"
156 >XEmacs CHISE</a> %s."
157 xemacs-chise-version))