(www-format-encode-string): Add settings for `===chise-hdic-tsj' and
[chise/ids.git] / www / www-ids-find.el
1 (require 'ids-find)
2 (require 'cwiki-common)
3
4 (defun www-format-encode-string (string &optional without-tags as-body)
5   (with-temp-buffer
6     (insert string)
7     (let (plane code subcode start end char variants ret rret)
8       (when as-body
9         (goto-char (point-min))
10         (while (search-forward "&" nil t)
11           (replace-match "&" nil t)))
12       (goto-char (point-min))
13       (while (search-forward "<" nil t)
14         (replace-match "&lt;" nil t))
15       (goto-char (point-min))
16       (while (search-forward ">" nil t)
17         (replace-match "&gt;" nil t))
18       (if without-tags
19           (encode-coding-region (point-min)(point-max) 'utf-8-mcs-er)
20         (let ((coded-charset-entity-reference-alist
21                (list*
22                 '(=gt                   "GT-" 5 d)
23                 '(=mj                    "MJ" 6 d)
24                 '(=hanyo-denshi/ja   "HD-JA-" 4 X)
25                 '(=hanyo-denshi/jb   "HD-JB-" 4 X)
26                 '(=hanyo-denshi/jc   "HD-JC-" 4 X)
27                 '(=hanyo-denshi/jd   "HD-JD-" 4 X)
28                 '(=hanyo-denshi/ft   "HD-FT-" 4 X)
29                 '(=hanyo-denshi/ia   "HD-IA-" 4 X)
30                 '(=hanyo-denshi/ib   "HD-IB-" 4 X)
31                 '(=hanyo-denshi/hg   "HD-HG-" 4 X)
32                 '(=hanyo-denshi/ip   "HD-IP-" 4 X)
33                 '(=hanyo-denshi/jt   "HD-JT-" 4 X)
34                 '(=hanyo-denshi/ks   "HD-KS-" 6 d)
35                 '(=>>hanyo-denshi/ja "G-HD-JA-" 4 X)
36                 '(=>>hanyo-denshi/jb "G-HD-JB-" 4 X)
37                 '(=>>hanyo-denshi/jc "G-HD-JC-" 4 X)
38                 '(=>>hanyo-denshi/jd "G-HD-JD-" 4 X)
39                 '(=>>hanyo-denshi/ft "G-HD-FT-" 4 X)
40                 '(=>>hanyo-denshi/ia "G-HD-IA-" 4 X)
41                 '(=>>hanyo-denshi/ib "G-HD-IB-" 4 X)
42                 '(=>>hanyo-denshi/hg "G-HD-HG-" 4 X)
43                 '(=>>hanyo-denshi/ip "G-HD-IP-" 4 X)
44                 '(=>>hanyo-denshi/jt "G-HD-JT-" 4 X)
45                 '(=>>hanyo-denshi/ks "G-HD-KS-" 6 d)
46                 '(==mj                  "g2-MJ" 6 d)
47                 '(==hanyo-denshi/ja "g2-HD-JA-" 4 X)
48                 '(==hanyo-denshi/jb "g2-HD-JB-" 4 X)
49                 '(==hanyo-denshi/jc "g2-HD-JC-" 4 X)
50                 '(==hanyo-denshi/jd "g2-HD-JD-" 4 X)
51                 '(==hanyo-denshi/ft "g2-HD-FT-" 4 X)
52                 '(==hanyo-denshi/ia "g2-HD-IA-" 4 X)
53                 '(==hanyo-denshi/ib "g2-HD-IB-" 4 X)
54                 '(==hanyo-denshi/hg "g2-HD-HG-" 4 X)
55                 '(==hanyo-denshi/ip "g2-HD-IP-" 4 X)
56                 '(==hanyo-denshi/jt "g2-HD-JT-" 4 X)
57                 '(==hanyo-denshi/ks "g2-HD-KS-" 6 d)
58                 '(==daijiten          "g2-DJT-" 5 d)
59                 '(=cns11643-1           "C1-" 4 X)
60                 '(=cns11643-2           "C2-" 4 X)
61                 '(=cns11643-3           "C3-" 4 X)
62                 '(=cns11643-4           "C4-" 4 X)
63                 '(=cns11643-5           "C5-" 4 X)
64                 '(=cns11643-6           "C6-" 4 X)
65                 '(=cns11643-7           "C7-" 4 X)
66                 '(=adobe-japan1-6       "AJ1-" 5 d)
67                 '(=big5-cdp             "CDP-" 4 X)
68                 '(=>big5-cdp          "A-CDP-" 4 X)
69                 '(=gb2312               "G0-" 4 X)
70                 '(=gb12345              "G1-" 4 X)
71                 '(=jis-x0208@1990       "J90-" 4 X)
72                 '(=jis-x0212            "JSP-" 4 X)
73                 '(=cbeta                "CB" 5 d)
74                 '(=jis-x0208@1997       "J97-" 4 X)
75                 '(=jis-x0208@1978       "J78-" 4 X)
76                 '(=jis-x0208@1983       "J83-" 4 X)
77                 '(=ruimoku-v6           "RUI6-" 4 X)
78                 '(=zinbun-oracle        "ZOB-" 4 d)
79                 '(=daijiten             "DJT-" 5 d)
80                 '(=jef-china3           "JC3-" 4 X)
81                 '(=ucs@unicode          "UU+" 4 X)
82                 '(=ucs@JP/hanazono  "hanaJU+" 4 X)
83                 '(==cns11643-1        "R-C1-" 4 X)
84                 '(==cns11643-2        "R-C2-" 4 X)
85                 '(==cns11643-3        "R-C3-" 4 X)
86                 '(==cns11643-4        "R-C4-" 4 X)
87                 '(==cns11643-5        "R-C5-" 4 X)
88                 '(==cns11643-6        "R-C6-" 4 X)
89                 '(==cns11643-7        "R-C7-" 4 X)
90                 '(=hanziku-1         "HZK01-" 4 X)
91                 '(=hanziku-2         "HZK02-" 4 X)
92                 '(=hanziku-3         "HZK03-" 4 X)
93                 '(=hanziku-4         "HZK04-" 4 X)
94                 '(=hanziku-5         "HZK05-" 4 X)
95                 '(=hanziku-6         "HZK06-" 4 X)
96                 '(=hanziku-7         "HZK07-" 4 X)
97                 '(=hanziku-8         "HZK08-" 4 X)
98                 '(=hanziku-9         "HZK09-" 4 X)
99                 '(=hanziku-10        "HZK10-" 4 X)
100                 '(=hanziku-11        "HZK11-" 4 X)
101                 '(=hanziku-12        "HZK12-" 4 X)
102                 '(==>daijiten       "A2-DJT-" 5 d)
103                 '(==cbeta               "CB" 5 d)
104                 '(=big5                  "B-" 4 X)
105                 '(=daikanwa              "M-" 5 d)
106                 '(=>>daikanwa          "G-M-" 5 d)
107                 '(===ucs@ks           "R-KU+" 4 X)
108                 coded-charset-entity-reference-alist)))
109           (encode-coding-region (point-min)(point-max) 'utf-8-mcs-er)
110
111           (goto-char (point-min))
112           (while (re-search-forward "&\\(A-\\|G-\\|g2-\\|R-\\)?CB\\([0-9]+\\);" nil t)
113             (setq code (string-to-int (match-string 2)))
114             (replace-match
115              (format "<img alt=\"CB%05d\" src=\"%s/cb-gaiji/%02d/CB%05d.gif\"
116 style=\"%s\">"
117                      code
118                      chise-wiki-legacy-bitmap-glyphs-url
119                      (/ code 1000) code
120                      www-format-char-img-style)
121              t 'literal))
122
123           (goto-char (point-min))
124           (while (re-search-forward "&\\(o-\\|G-\\|g2-\\|R-\\)?J\\(78\\|83\\|90\\|97\\|SP\\)-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t)
125             (setq plane (match-string 2)
126                   code (string-to-int (match-string 3) 16))
127             (replace-match
128              (format "<img alt=\"J%s-%04X\" src=\"%s/JIS-%s/%02d-%02d.gif\"
129 style=\"%s\">"
130                      plane code
131                      chise-wiki-legacy-bitmap-glyphs-url
132                      plane
133                      (- (lsh code -8) 32)
134                      (- (logand code 255) 32)
135                      www-format-char-img-style)
136              t 'literal))
137
138           (goto-char (point-min))
139           (while (re-search-forward "&\\(o-\\|G-\\|g2-\\|R-\\)?J0-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t)
140             (setq code (string-to-int (match-string 2) 16))
141             (replace-match
142              (format "<img alt=\"J0-%04X\" src=\"%s/JIS-90/%02d-%02d.gif\"
143 style=\"%s\">"
144                      code
145                      chise-wiki-legacy-bitmap-glyphs-url
146                      (- (lsh code -8) 32)
147                      (- (logand code 255) 32)
148                      www-format-char-img-style)
149              t 'literal))
150
151           (goto-char (point-min))
152           (while (re-search-forward "&\\(o-\\|G-\\|g2-\\|R-\\)?HD-\\(JA\\|JB\\|JC\\|JD\\|FT\\|IA\\|IB\\|HG\\)-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t)
153             (setq plane (match-string 2)
154                   code (string-to-int (match-string 3) 16))
155             (replace-match
156              (format "<img alt=\"HD-%s-%04X\" src=\"%s/IVD/HanyoDenshi/%s%02d%02d.png\"
157 style=\"%s\">"
158                      plane code
159                      chise-wiki-legacy-bitmap-glyphs-url
160                      plane
161                      (- (lsh code -8) 32)
162                      (- (logand code 255) 32)
163                      www-format-char-img-style)
164              t 'literal))
165
166           (goto-char (point-min))
167           (while (re-search-forward "&\\(o-\\|G-\\|g2-\\|R-\\)?HD-\\(IP\\|JT\\)-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t)
168             (setq plane (match-string 2)
169                   code (string-to-int (match-string 3) 16))
170             (replace-match
171              (format "<img alt=\"HD-%s-%04X\" src=\"%s/IVD/HanyoDenshi/%s%04X.png\"
172 style=\"%s\">"
173                      plane code
174                      chise-wiki-legacy-bitmap-glyphs-url
175                      plane code
176                      www-format-char-img-style)
177              t 'literal))
178
179           (goto-char (point-min))
180           (while (re-search-forward "&\\(o-\\|G-\\|g2-\\|R-\\)?HD-KS-\\([0-9]+\\);" nil t)
181             (setq code (string-to-int (match-string 2)))
182             (replace-match
183              (format "<img alt=\"HD-KS%06d\" src=\"%s/IVD/HanyoDenshi/KS%06d.png\"
184 style=\"vertical-align:middle\">"
185                      code
186                      chise-wiki-legacy-bitmap-glyphs-url
187                      code
188                      www-format-char-img-style)
189              t 'literal))
190
191           (goto-char (point-min))
192           (while (re-search-forward "&\\(o-\\|G-\\|g2-\\|R-\\)?HD-TK-\\([0-9]+\\);" nil t)
193             (setq code (string-to-int (match-string 2)))
194             (replace-match
195              (format "<img alt=\"HD-KS%06d\" src=\"%s/IVD/HanyoDenshi/TK%08d.png\"
196 style=\"vertical-align:middle\">"
197                      code
198                      chise-wiki-legacy-bitmap-glyphs-url
199                      code
200                      www-format-char-img-style)
201              t 'literal))
202
203           (goto-char (point-min))
204           (while (re-search-forward "&G\\([01]\\)-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t)
205             (setq plane (string-to-int (match-string 1))
206                   code (string-to-int (match-string 2) 16))
207             (replace-match
208              (format "<img alt=\"GB%d-%04X\" src=\"%s/GB%d/%02d-%02d.gif\"
209 style=\"%s\">"
210                      plane code
211                      chise-wiki-legacy-bitmap-glyphs-url
212                      plane
213                      (- (lsh code -8) 32)
214                      (- (logand code 255) 32)
215                      www-format-char-img-style)
216              t 'literal))
217
218           (goto-char (point-min))
219           (while (re-search-forward "&\\(R-\\)?C\\([1-7]\\)-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t)
220             (setq plane (string-to-int (match-string 2))
221                   code (string-to-int (match-string 3) 16))
222             (replace-match
223              (format "<img alt=\"CNS%d-%04X\" src=\"%s/CNS%d/%04X.gif\"
224 style=\"%s\">"
225                      plane code
226                      chise-wiki-legacy-bitmap-glyphs-url
227                      plane code
228                      www-format-char-img-style)
229              t 'literal))
230
231           (goto-char (point-min))
232           (while (re-search-forward "&\\(R-\\)?JC3-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t)
233             (setq code (string-to-int (match-string 2) 16))
234             (replace-match
235              (format "<img alt=\"JC3-%04X\" src=\"%s/JEF-CHINA3/%04X.png\">"
236                      code chise-wiki-bitmap-glyph-image-url code)
237              t 'literal))
238
239           (goto-char (point-min))
240           (while (re-search-forward "&\\(A-\\)?ZOB-\\([0-9]+\\);" nil t)
241             (setq code (string-to-int (match-string 2)))
242             (replace-match
243              (format "<img alt=\"ZOB-%04d\" src=\"%s/ZOB-1968/%04d.png\"
244 style=\"vertical-align:middle\">"
245                      code
246                      chise-wiki-legacy-bitmap-glyphs-url
247                      code
248                      www-format-char-img-style)
249              t 'literal))
250
251           (goto-char (point-min))
252           (while (re-search-forward "&\\(A2-\\|g2-\\|R-\\)?DJT-\\([0-9]+\\);" nil t)
253             (setq code (string-to-int (match-string 2)))
254             (replace-match
255              (format "<img alt=\"DJT-%05d\" src=\"%s/%05d.png\"
256 style=\"vertical-align:middle; width: auto; max-height: 60px\">"
257                      code
258                      chise-wiki-daijiten-bitmap-glyphs-url
259                      code
260                      www-format-char-img-style)
261              t 'literal))
262
263           (goto-char (point-min))
264           (while (re-search-forward "&SW-JIGUGE\\([45]?\\)-\\([0-9]+\\);" nil t)
265             (setq subcode (match-string 1)
266                   code (string-to-int (match-string 2)))
267             (setq plane
268                   (if (string= subcode "")
269                       "5"
270                     subcode))
271             (replace-match
272              (format "<img alt=\"SW-JIGUGE%s-%05d\" src=\"%s/ShuoWen/Jiguge%s/%05d.png\"
273 style=\"vertical-align:middle; width: auto; max-height: 80px\">"
274                      plane code
275                      chise-wiki-legacy-bitmap-glyphs-url
276                      plane code)
277              t 'literal))
278
279           (goto-char (point-min))
280           (while (re-search-forward "&HNG\\([0-9]+\\)-\\([0-9][0-9][0-9][0-9]\\)\\([0-9]\\);" nil t)
281             (setq plane (match-string 1)
282                   code (string-to-int (match-string 2))
283                   subcode (string-to-int (match-string 3)))
284             (setq subcode
285                   (if (eq subcode 0)
286                       ""
287                     (char-to-string (decode-char 'ascii (+ 96 subcode)))))
288             (replace-match
289              (format
290               "<img alt=\"HNG%s-%04d%s\" src=\"%s/%s/%04d%s.png\" style=\"
291 vertical-align:middle; width: auto; max-height: 60px\">"
292               plane code subcode
293               chise-wiki-hng-bitmap-glyphs-url
294               plane code subcode
295               )
296              t 'literal))
297
298           (goto-char (point-min))
299           (while (re-search-forward "&\\(R-\\)?CHISE-HDIC-TSJ\\([0-9A-F]+\\);" nil t)
300             (setq code (string-to-int (match-string 2) 16))
301             (setq char (decode-char '===chise-hdic-tsj code))
302             (when (setq ret (get-char-attribute char '=hdic-tsj-glyph-id))
303               (replace-match
304                (format
305                 "<img alt=\"HDIC-TSJ-%s\" src=\"https://viewer.hdic.jp/img/tsj/%s.jpg\" style=\"
306 vertical-align:middle; width: auto; max-height: 60px\">"
307                 ret ret)
308                t 'literal)))
309
310           (goto-char (point-min))
311           (while (re-search-forward "&\\(o-\\|G-\\|g2-\\|R-\\)?AJ1-\\([0-9]+\\);" nil t)
312             (setq code (string-to-int (match-string 2)))
313             (replace-match
314              (format "<img alt=\"AJ1-%05d\" src=\"%s/IVD/AdobeJapan1/CID+%d.png\"
315 style=\"vertical-align:middle\">"
316                      code
317                      chise-wiki-legacy-bitmap-glyphs-url
318                      code
319                      www-format-char-img-style)
320              t 'literal))
321
322           (goto-char (point-min))
323           (while (re-search-forward "&\\(A-\\|o-\\|G-\\|g2-\\|R-\\)?MJ\\([0-9]+\\);" nil t)
324             (setq code (string-to-int (match-string 2)))
325             (replace-match
326              (format "<img alt=\"MJ%06d\" src=\"https://moji.or.jp/mojikibansearch/img/MJ/MJ%06d.png\"
327 style=\"vertical-align:middle; width: 48px; height: 48px\">"
328                      code
329                      code
330                      www-format-char-img-style)
331              t 'literal))
332
333           (goto-char (point-min))
334           (while (re-search-forward "&\\(o-\\|G-\\|g2-\\)?IU[+-]\\([0-9A-F]+\\);" nil t)
335             (setq code (string-to-int (match-string 2) 16))
336             (replace-match
337              (format "<img alt=\"u%04x\" src=\"%s/u%04x.svg\"
338 style=\"vertical-align:middle; width: 48px; height: 48px\">"
339                      code
340                      chise-wiki-glyphwiki-glyph-image-url
341                      code
342                      www-format-char-img-style)
343              t 'literal))
344
345           (goto-char (point-min))
346           (while (re-search-forward "&\\(o-\\|G-\\|g2-\\|R-\\)?KU[+-]\\([0-9A-F]+\\);" nil t)
347             (setq code (string-to-int (match-string 2) 16))
348             (replace-match
349              (format "<img alt=\"u%04x-k\" src=\"%s/u%04x-k.svg\"
350 style=\"vertical-align:middle; width: 48px; height: 48px\">"
351                      code
352                      chise-wiki-glyphwiki-glyph-image-url
353                      code
354                      www-format-char-img-style)
355              t 'literal))
356
357           (goto-char (point-min))
358           (while (re-search-forward "&A-\\(comp\\|cgn\\)U[+-]\\([0-9A-F]+\\);" nil t)
359             (setq code (string-to-int (match-string 2) 16))
360             (replace-match
361              (format "<img alt=\"u%04x\" src=\"%s/u%04x.svg\"
362 style=\"vertical-align:middle; width: 48px; height: 48px\">"
363                      code
364                      chise-wiki-glyphwiki-glyph-image-url
365                      code
366                      www-format-char-img-style)
367              t 'literal))
368
369           (goto-char (point-min))
370           (while (re-search-forward
371                   "&\\(A-\\|g2-\\)?U-i\\([0-9]+\\)\\+\\([0-9A-F]+\\);"
372                   nil t)
373             (setq plane (string-to-int (match-string 2))
374                   code (string-to-int (match-string 3) 16))
375             (replace-match
376              (format "<img alt=\"u%04x-itaiji-%03d\" src=\"%s/u%04x-itaiji-%03d.svg\"
377 style=\"vertical-align:middle; width: 48px; height: 48px\">"
378                      code
379                      plane
380                      chise-wiki-glyphwiki-glyph-image-url
381                      code
382                      plane
383                      www-format-char-img-style)
384              t 'literal))
385
386           (goto-char (point-min))
387           (while (re-search-forward "&A-IWDSU\\+\\([0-9A-F]+\\);" nil t)
388             (setq code (string-to-int (match-string 1) 16))
389             (replace-match
390              (format "<img alt=\"A-IWDSU+%04x\" src=\"%s/u%04x.svg\"
391 style=\"vertical-align:middle; width: 48px; height: 48px\">"
392                      code
393                      chise-wiki-glyphwiki-glyph-image-url
394                      code
395                      www-format-char-img-style)
396              t 'literal))
397
398           (goto-char (point-min))
399           (while (re-search-forward
400                   "&\\(A-\\)?CDP-i\\([0-9]+\\)-\\([0-9A-F]+\\);"
401                   nil t)
402             (setq plane (string-to-int (match-string 2))
403                   code (string-to-int (match-string 3) 16))
404             (replace-match
405              (format "<img alt=\"cdp-%04x-itaiji-%03d\" src=\"%s/cdp-%04x-itaiji-%03d.svg\"
406 style=\"vertical-align:middle; width: 48px; height: 48px\">"
407                      code
408                      plane
409                      chise-wiki-glyphwiki-glyph-image-url
410                      code
411                      plane
412                      www-format-char-img-style)
413              t 'literal))
414
415           (goto-char (point-min))
416           (while (re-search-forward
417                   "&\\(A-\\)?CDP-v\\([0-9]+\\)-\\([0-9A-F]+\\);"
418                   nil t)
419             (setq plane (string-to-int (match-string 2))
420                   code (string-to-int (match-string 3) 16))
421             (replace-match
422              (format "<img alt=\"cdp-%04x-var-%03d\" src=\"%s/cdp-%04x-var-%03d.svg\"
423 style=\"vertical-align:middle; width: 48px; height: 48px\">"
424                      code
425                      plane
426                      chise-wiki-glyphwiki-glyph-image-url
427                      code
428                      plane
429                      www-format-char-img-style)
430              t 'literal))
431
432           (goto-char (point-min))
433           (while (re-search-forward
434                   "&\\(A-\\|G-\\|g2-\\|R-\\)?M-\\([0-9]+\\);"
435                   nil t)
436             (setq code (string-to-int (match-string 2)))
437             (replace-match
438              (format "<img alt=\"dkw-%05d\" src=\"%s/dkw-%05d.svg\"
439 style=\"vertical-align:middle; width: 48px; height: 48px\">"
440                      code
441                      chise-wiki-glyphwiki-glyph-image-url
442                      code
443                      www-format-char-img-style)
444              t 'literal))
445
446           (goto-char (point-min))
447           (while (re-search-forward "&\\(g2-\\)?U-v\\([0-9]+\\)\\+\\([0-9A-F]+\\);" nil t)
448             (setq plane (string-to-int (match-string 2))
449                   code (string-to-int (match-string 3) 16))
450             (replace-match
451              (format "<img alt=\"u%04x-var-%03d\" src=\"%s/u%04x-var-%03d.svg\"
452 style=\"vertical-align:middle; width: 48px; height: 48px\">"
453                      code
454                      plane
455                      chise-wiki-glyphwiki-glyph-image-url
456                      code
457                      plane
458                      www-format-char-img-style)
459              t 'literal))
460
461           (goto-char (point-min))
462           (while (re-search-forward "&\\(A-\\|G-\\|R-\\|g2-\\)?GT-\\([0-9]+\\);" nil t)
463             (setq code (string-to-int (match-string 2)))
464             (replace-match
465              (format "<img alt=\"GT-%05d\" src=\"%s?char=GT-%05d\"
466 style=\"%s\">"
467                      code
468                      chise-wiki-glyph-cgi-url
469                      code
470                      www-format-char-img-style)
471              t 'literal))
472
473           (goto-char (point-min))
474           (while (re-search-forward "&\\(A-\\|G-\\|g2-\\)?GT-K\\([0-9]+\\);" nil t)
475             (setq code (string-to-int (match-string 2)))
476             (replace-match
477              (format "<img alt=\"GT-K%05d\" src=\"%s?char=GT-K%05d\"
478 style=\"%s\">"
479                      code
480                      chise-wiki-glyph-cgi-url
481                      code
482                      www-format-char-img-style)
483              t 'literal))
484
485           (goto-char (point-min))
486           (while (re-search-forward "&B-\\([0-9A-F]+\\);" nil t)
487             (setq code (string-to-int (match-string 1) 16))
488             (replace-match
489              (format "<img alt=\"B-%04X\" src=\"%s?char=B-%04X\"
490 style=\"%s\">"
491                      code
492                      chise-wiki-glyph-cgi-url
493                      code
494                      www-format-char-img-style)
495              t 'literal))
496
497           (goto-char (point-min))
498           (while (re-search-forward
499                   "&\\(A-\\|G-\\|g2-\\|R-\\)?CDP-\\([0-9A-F]+\\);" nil t)
500             (setq code (string-to-int (match-string 2) 16))
501             (replace-match
502              (format "<img alt=\"CDP-%04X\" src=\"%s?char=CDP-%04X\"
503 style=\"%s\">"
504                      code
505                      chise-wiki-glyph-cgi-url
506                      code
507                      www-format-char-img-style)
508              t 'literal))
509
510           (goto-char (point-min))
511           (while (re-search-forward
512                   "&\\(I-\\)?HZK\\(0[1-9]\\|1[0-2]\\)-\\([0-9A-F]+\\);" nil t)
513             (setq plane (match-string 2)
514                   code (string-to-int (match-string 3) 16))
515             (replace-match
516              (format "<img alt=\"HZK%s-%04X\" src=\"%s?char=HZK%s-%04X\"
517 style=\"%s\">"
518                      plane
519                      code
520                      chise-wiki-glyph-cgi-url
521                      plane
522                      code
523                      www-format-char-img-style)
524              t 'literal))
525
526           (goto-char (point-min))
527           (while (re-search-forward "&\\(A-\\|G-\\|g2-\\|R-\\)?RUI6-\\([0-9A-F]+\\);" nil t)
528             (setq code (string-to-int (match-string 2) 16))
529             (replace-match
530              (format "<img alt=\"RUI6-%04X\" src=\"%s?char=RUI6-%04X\"
531 style=\"vertical-align:middle\">"
532                      code
533                      chise-wiki-glyph-cgi-url
534                      code
535                      www-format-char-img-style)
536              t 'literal))
537
538           (goto-char (point-min))
539           (while (re-search-forward "&hanaJU\\+\\([0-9A-F]+\\);" nil t)
540             (setq code (string-to-int (match-string 1) 16))
541             (replace-match
542              (format "<img alt=\"hanaJU+%04X\" src=\"%s?char=hana-JU+%04X\"
543 style=\"vertical-align:middle\">"
544                      code
545                      chise-wiki-glyph-cgi-url
546                      code
547                      www-format-char-img-style)
548              t 'literal))
549
550           (goto-char (point-min))
551           (while (re-search-forward "&\\(A-\\|G-\\|g2-\\|R-\\)?\\(UU\\+\\|U-\\)\\([0-9A-F]+\\);" nil t)
552             (setq code (string-to-int (match-string 3) 16))
553             (replace-match
554              (format "<img alt=\"UU+%04X\" src=\"https://www.unicode.org/cgi-bin/refglyph?24-%04X\"
555 style=\"vertical-align:middle\">"
556                      code
557                      code
558                      www-format-char-img-style)
559              t 'literal))
560
561           (goto-char (point-min))
562           (while (re-search-forward "&MCS-\\([0-9A-F]+\\);" nil t)
563             (setq code (string-to-int (match-string 1) 16))
564             (setq start (match-beginning 0)
565                   end (match-end 0))
566             (setq char (decode-char 'system-char-id code))
567             (cond
568              ((and (setq variants
569                          (or (www-get-feature-value char '->subsumptive)
570                              (www-get-feature-value char '->denotational)))
571                    (progn
572                      (if (characterp variants)
573                          (setq variants (list variants)))
574                      (while (and variants
575                                  (setq ret (www-format-encode-string
576                                             (char-to-string (car variants))))
577                                  (string-match "&MCS-\\([0-9A-F]+\\);" ret))
578                        (setq variants (cdr variants)))
579                      ret))
580               (unless (string-match "&MCS-\\([0-9A-F]+\\);" ret)
581                 (goto-char start)
582                 (delete-region start end)
583                 (insert ret))
584               )
585              ((setq ret (or (www-get-feature-value char 'ideographic-combination)
586                             (www-get-feature-value char 'ideographic-structure)))
587               (setq ret
588                     (mapconcat
589                      (lambda (ch)
590                        (if (listp ch)
591                            (if (characterp (setq rret (find-char ch)))
592                                (setq ch rret)))
593                        (if (characterp ch)
594                            (www-format-encode-string
595                             (char-to-string ch) without-tags)
596                          (www-format-encode-string
597                           (format "%S" ch) without-tags)))
598                      ret ""))
599               (when ret
600                 (goto-char start)
601                 (delete-region start end)
602                 (insert ret))
603               )))
604           ))
605       ;; (goto-char (point-min))
606       ;; (while (search-forward "&GT-" nil t)
607       ;;   (replace-match "&amp;GT-" t 'literal))
608       (buffer-string))))
609
610 (setq www-format-char-img-style "vertical-align:middle;")
611
612 (defun decode-url-string (string &optional coding-system)
613   (if (> (length string) 0)
614       (let ((i 0)
615             dest)
616         (while (string-match "%\\([0-9A-F][0-9A-F]\\)" string i)
617           (setq dest (concat dest
618                              (substring string i (match-beginning 0))
619                              (char-to-string
620                               (int-char
621                                (string-to-int (match-string 1 string) 16))))
622                 i (match-end 0)))
623         (decode-coding-string
624          (concat dest (substring string i))
625          coding-system))))
626
627 (defconst www-ids-find-version "0.99.2")
628
629 (defvar www-ids-find-ideographic-products-file-name
630   (expand-file-name "ideographic-products"
631                     (expand-file-name
632                      "feature"
633                      (expand-file-name
634                       "character"
635                       chise-system-db-directory))))
636
637 (defvar www-ids-find-char-viewer-url
638   "/est/view/character/")
639
640 (defvar www-ids-find-chise-link-map-url-prefix
641   "http://fonts.jp/chise_linkmap/map.cgi?code=")
642
643 (defvar www-ids-find-tang-chars-file-name
644   "~tomo/projects/chise/ids/www/tang-chars.udd")
645
646 (defun www-ids-find-format-char (c &optional code-desc)
647   (princ
648    (format "<a href=\"%s%s\">%s</a>"
649            www-ids-find-char-viewer-url
650            (www-uri-encode-object c)
651            (www-format-encode-string (char-to-string c))))
652   ;; (let ((str (encode-coding-string (format "%c" c) 'utf-8-er))
653   ;;       plane code)
654   ;;   (princ
655   ;;    (with-temp-buffer
656   ;;      (cond
657   ;;       ((string-match "&CB\\([0-9]+\\);" str)
658   ;;        (setq code (string-to-int (match-string 1 str)))
659   ;;        (insert (format "<a href=\"%s"
660   ;;                        www-ids-find-char-viewer-url))
661   ;;        (insert str)
662   ;;        (insert (format "\"><img alt=\"CB%05d\" src=\"/glyphs/cb-gaiji/%02d/CB%05d.gif\">\n"
663   ;;                        code (/ code 1000) code))
664   ;;        (when code-desc
665   ;;          (insert (format "CB%05d</a>" code)))
666   ;;        )
667   ;;       ((string-match "&JC3-\\([0-9A-F]+\\);" str)
668   ;;        (setq code (string-to-int (match-string 1 str) 16))
669   ;;        (insert (format "<a href=\"%s"
670   ;;                        www-ids-find-char-viewer-url))
671   ;;        (insert str)
672   ;;        (insert (format "\"><img alt=\"JC3-%04X\" src=\"http://kanji.zinbun.kyoto-u.ac.jp/db/CHINA3/Gaiji/%04x.gif\">\n"
673   ;;                        code code))
674   ;;        (when code-desc
675   ;;          (insert (format "JC3-%04X</a>" code)))
676   ;;        )
677   ;;       ((string-match "&J\\(78\\|83\\|90\\|SP\\)-\\([0-9A-F]+\\);" str)
678   ;;        (setq plane (match-string 1 str)
679   ;;              code (string-to-int (match-string 2 str) 16))
680   ;;        (insert (format "<a href=\"%s"
681   ;;                        www-ids-find-char-viewer-url))
682   ;;        (insert str)
683   ;;        (insert (format "\"><img alt=\"J%s-%04X\" src=\"/glyphs/JIS-%s/%02d-%02d.gif\">\n"
684   ;;                        plane code plane
685   ;;                        (- (lsh code -8) 32)
686   ;;                        (- (logand code 255) 32)))
687   ;;        (when code-desc
688   ;;          (insert (format "J%s-%04X</a>" plane code)))
689   ;;        )
690   ;;       ((string-match "&G\\([01]\\)-\\([0-9A-F]+\\);" str)
691   ;;        (setq plane (string-to-int (match-string 1 str))
692   ;;              code (string-to-int (match-string 2 str) 16))
693   ;;        (insert (format "<a href=\"%s"
694   ;;                        www-ids-find-char-viewer-url))
695   ;;        (insert str)
696   ;;        (insert (format "\"><img alt=\"G%d-%04X\" src=\"/glyphs/GB%d/%02d-%02d.gif\">\n"
697   ;;                        plane code plane
698   ;;                        (- (lsh code -8) 32)
699   ;;                        (- (logand code 255) 32)))
700   ;;        (when code-desc
701   ;;          (insert (format "G%d-%04X</a>" plane code)))
702   ;;        )
703   ;;       ((string-match "&C\\([1-7]\\)-\\([0-9A-F]+\\);" str)
704   ;;        (setq plane (string-to-int (match-string 1 str))
705   ;;              code (string-to-int (match-string 2 str) 16))
706   ;;        (insert (format "<a href=\"%s"
707   ;;                        www-ids-find-char-viewer-url))
708   ;;        (insert str)
709   ;;        (insert (format "\"><img alt=\"C%d-%04X\" src=\"/glyphs/CNS%d/%04X.gif\">\n"
710   ;;                        plane code plane code))
711   ;;        (when code-desc
712   ;;          (insert (format "C%d-%04X</a>" plane code)))
713   ;;        )
714   ;;       ((string-match "&ZOB-\\([0-9]+\\);" str)
715   ;;        (setq code (string-to-int (match-string 1 str)))
716   ;;        (insert (format "<a href=\"%s"
717   ;;                        www-ids-find-char-viewer-url))
718   ;;        (insert str)
719   ;;        (insert (format "\"><img alt=\"ZOB-%04d\" src=\"/glyphs/ZOB-1968/%04d.png\">\n"
720   ;;                        code code))
721   ;;        (when code-desc
722   ;;          (insert (format "ZOB-%04d</a>" code)))
723   ;;        )
724   ;;       (t
725   ;;        (insert (format "<a href=\"%s"
726   ;;                        www-ids-find-char-viewer-url))
727   ;;        ;; (insert str)
728   ;;        (insert
729   ;;         (mapconcat (lambda (c)
730   ;;                      (if (<= (char-int c) #x7F)
731   ;;                          (char-to-string c)
732   ;;                        (format "%%%02X" c)))
733   ;;                    str ""))
734   ;;        (insert "\">")
735   ;;        (insert str)
736   ;;        (insert "</a>")
737   ;;        ))
738   ;;      (goto-char (point-min))
739   ;;      (while (search-forward "&" nil t)
740   ;;        (replace-match "&amp;" t 'literal))
741   ;;      (buffer-string))))
742   )
743   
744 (defun www-ids-find-format-line (c is)
745   (let (ucs len i ids)
746     (princ "<span class=\"entry\">")
747     (www-ids-find-format-char c 'code-desc)
748     (princ "</span>")
749     (princ
750      (or (if (setq ucs (or (char-ucs c)
751                            (encode-char c 'ucs)))
752              (format
753               " <a href=\"http://www.unicode.org/cgi-bin/GetUnihanData.pl?codepoint=%X\">%s</a>"
754               ucs
755               (cond ((<= ucs #xFFFF)
756                      (format "U+%04X" ucs))
757                     ((<= ucs #x10FFFF)
758                      (format "U-%08X" ucs))))
759            "          ")))
760     (when ucs
761       (princ
762        (format " <a href=\"%s%X\">(link map)</a>"
763                www-ids-find-chise-link-map-url-prefix ucs)))
764     (princ " ")
765     (when is
766       (setq ids (ideographic-structure-to-ids is))
767       (setq i 0
768             len (length ids))
769       (princ "<span class=\"ids\">")      
770       (while (< i len)
771         (www-ids-find-format-char (aref ids i))
772         (setq i (1+ i)))
773       (princ "</span>"))
774     (when (and ucs
775                (with-current-buffer
776                    (find-file-noselect
777                     www-ids-find-tang-chars-file-name)
778                  (goto-char (point-min))
779                  (re-search-forward (format "^%d$" ucs) nil t)))
780       (princ
781        (format " <a href=\"http://coe21.zinbun.kyoto-u.ac.jp/djvuchar?query=%s\">"
782                (mapconcat
783                 (lambda (c)
784                   (format "%%%02X" (char-int c)))
785                 (encode-coding-string (char-to-string c)
786                                       'utf-8-jp)
787                 "")))
788       (princ (encode-coding-string "\e$B"M\e(B[\e$BEbBeBsK\\e(B]</a>" 'utf-8-jp-er)))
789     (princ "<br>\n")))
790
791 (defun www-ids-insert-chars-including-components* (components
792                                                    &optional ignored-chars products)
793   (unless products
794     (setq products (ideograph-find-products components ignored-chars)))
795   (let (is as bs len)
796     (setq len (length products))
797     (princ "<ul>\n")
798     (dolist (c (cond
799                 ((>= len 1024)
800                  (sort (copy-list products)
801                        (lambda (a b)
802                          (< (char-int a)(char-int b))))
803                  )
804                 ((>= len 512)
805                  (sort (copy-list products)
806                        (lambda (a b)
807                          (if (setq as (char-total-strokes a))
808                              (if (setq bs (char-total-strokes b))
809                                  (if (= as bs)
810                                      (< (char-int a)(char-int b))
811                                    (< as bs))
812                                t)
813                            (< (char-int a)(char-int b)))))
814                  )
815                 (t
816                  (sort (copy-list products)
817                        (lambda (a b)
818                          (if (setq as (char-total-strokes a))
819                              (if (setq bs (char-total-strokes b))
820                                  (if (= as bs)
821                                      (ideograph-char< a b)
822                                    (< as bs))
823                                t)
824                            (ideograph-char< a b))))
825                  )))
826       (unless (memq c ignored-chars)
827         (setq is (char-feature c 'ideographic-structure))
828         (princ "<li>")
829         (www-ids-find-format-line c is)
830         (setq ignored-chars
831               (www-ids-insert-chars-including-components*
832                (char-to-string c) (cons c ignored-chars)))
833         )
834       )
835     (princ "</ul>\n")
836     )
837   ignored-chars)
838
839 (defun www-ids-insert-chars-including-components (components
840                                                   &optional ignored-chars)
841   (let ((products (ideograph-find-products components ignored-chars))
842         is as bs len ignore-children)
843     (setq len (length products))
844     (when (>= len 1024)
845       (setq ignore-children t)
846       (princ
847        (encode-coding-string
848         "<p>\e$B7k2L$,B?$9$.$k$?$a!":F5"E*8!:w$r>JN,$7$^$7$?!#\e(B</p>"
849         'utf-8-jp-er)))
850     (if (>= len 2048)
851         (dolist (c products)
852           (www-ids-find-format-char c))
853       (setq ignored-chars
854             (nreverse
855              (www-ids-insert-chars-including-components* components ignored-chars products)))
856       (dolist (c ignored-chars)
857         (dolist (vc (char-component-variants c))
858           (unless (memq vc ignored-chars)
859             (when (setq is (get-char-attribute vc 'ideographic-structure))
860               (princ "<li>")
861               (www-ids-find-format-line vc is)
862               (setq ignored-chars
863                     (www-ids-insert-chars-including-components*
864                      (char-to-string vc)
865                      (cons vc ignored-chars)))))))
866       (setq products (ideograph-find-products-with-variants components ignored-chars))
867       (setq len (length products))
868       (when (>= len 512)
869         (setq ignore-children t)
870         (princ
871          (encode-coding-string
872           "<p>\e$B7k2L$,B?$9$.$k$?$a!"4XO";z$N:F5"E*8!:w$r>JN,$7$^$7$?!#\e(B</p>"
873           'utf-8-jp-er)))
874       (if (>= len 1024)
875           (dolist (c products)
876             (www-ids-find-format-char c))
877         (dolist (c (sort (copy-tree products)
878                          (lambda (a b)
879                            (if (setq as (char-total-strokes a))
880                                (if (setq bs (char-total-strokes b))
881                                    (if (= as bs)
882                                        (ideograph-char< a b)
883                                      (< as bs))
884                                  t)
885                              (ideograph-char< a b)))))
886           (unless (memq c ignored-chars)
887             (setq is (get-char-attribute c 'ideographic-structure))
888             (princ "<li>")
889             (www-ids-find-format-line c is)
890             (unless ignore-children
891               (setq ignored-chars
892                     (www-ids-insert-chars-including-components*
893                      (char-to-string c)
894                      (cons c ignored-chars))))
895             ))
896         ))
897     )
898   ignored-chars)
899
900 (defun www-batch-ids-find ()
901   (let ((components (car command-line-args-left))
902         (coded-charset-entity-reference-alist
903          (list*
904           '(=cns11643-1         "C1-" 4 X)
905           '(=cns11643-2         "C2-" 4 X)
906           '(=cns11643-3         "C3-" 4 X)
907           '(=cns11643-4         "C4-" 4 X)
908           '(=cns11643-5         "C5-" 4 X)
909           '(=cns11643-6         "C6-" 4 X)
910           '(=cns11643-7         "C7-" 4 X)
911           '(=gb2312             "G0-" 4 X)
912           '(=gb12345            "G1-" 4 X)
913           '(=jis-x0208@1990     "J90-" 4 X)
914           '(=jis-x0212          "JSP-" 4 X)
915           '(=cbeta              "CB" 5 d)
916           '(=jef-china3         "JC3-" 4 X)
917           '(=jis-x0208@1978     "J78-" 4 X)
918           '(=jis-x0208@1983     "J83-" 4 X)
919           '(=daikanwa           "M-" 5 d)
920           coded-charset-entity-reference-alist))
921         )
922     (setq command-line-args-left (cdr command-line-args-left))
923     (cond
924      ((stringp components)
925       (if (string-match "^components=" components)
926           (setq components (substring components (match-end 0))))
927       (setq components
928             (if (> (length components) 0)
929                 (decode-url-string components 'utf-8-er)
930               nil))
931       )
932      (t
933       (setq components nil)
934       ))
935     (princ "Content-Type: text/html; charset=UTF-8
936
937 <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
938             \"http://www.w3.org/TR/html4/loose.dtd\">
939 <html lang=\"ja\">
940 <head>
941 <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
942 <title>CHISE IDS Find</title>
943 <link href=\"/css/bootstrap-4.5.0.min.css\" rel=\"stylesheet\">
944 <style type=\"text/css\">
945 <!--
946 .entry { font-size: 36px; }
947 .entry a img { height: 36px; }
948 .ids { font-size: 24px; }
949 .ids a img { height: 24px; }
950 img { vertical-align:middle; }
951 a { text-decoration:none; }
952 ul { margin: 0 0; }
953 li { margin: 0 0 -0.2em; }
954 .tooltip {
955     position: relative;
956     display: inline-block;
957 }
958 .tooltip .tooltiptext {
959     display: none;
960 }
961 -->
962 </style>
963 </head>
964
965 <body>
966
967 <div class=\"jumbotron jumbotron-fluid mb-0\">
968 <h1 class=\"display-4 text-center\">")
969     (princ (encode-coding-string "CHISE IDS \e$B4A;z8!:w\e(B" 'utf-8-jp-er))
970     (princ "</h1>")
971     (princ "
972 <p class=\"text-center\">Version ")
973     (princ www-ids-find-version)
974     (princ (format-time-string
975             " (Last-modified: %Y-%m-%d %H:%M:%S)</p>"
976             (nth 5
977                  (file-attributes
978                   www-ids-find-ideographic-products-file-name))))
979     (princ "
980 </div>
981 <div class=\"container mt-0 mw-100 d-inline-block align-top bg-dark\">
982 <p />
983 <div class=\"input-group mb-3 h3 my-4\">
984 <div class=\"input-group-prepend mw-75 ml-3\">
985 <form action=\"/ids-find\" method=\"GET\">
986 <span class=\"input-group-text\" id=\"basic-addon1\">
987 ")
988     (princ (encode-coding-string "\e$BItIJJ8;zNs\e(B" 'utf-8-jp-er))
989     (princ "</span>
990 </div>
991 <input type=\"text\" class=\"form-control\" aria-describedby=\"basic-addon1\" name=\"components\" size=\"30\" maxlength=\"256\" value=\"")
992     (if (> (length components) 0)
993         (princ (encode-coding-string components 'utf-8-er)))
994     (princ "\">
995 <input class=\"mr-3\" type=\"submit\" value=\"")
996     (princ (encode-coding-string "\e$B8!:w3+;O\e(B" 'utf-8-jp-er))
997     (princ "\">
998 </form>
999 </div>
1000 </div>
1001
1002 ")
1003     (unless (file-newer-than-file-p
1004              www-ids-find-ideographic-products-file-name
1005              (locate-file (car command-line-args) exec-path))
1006       (princ (encode-coding-string "<hr>
1007 <p>
1008 \e$B8=:_!"%7%9%F%`$N99?7:n6HCf$G$9!#$7$P$i$/$*BT$A$/$@$5$$!#\e(B
1009 <hr>
1010 " 'utf-8-jp-er))
1011       ;; (setq components nil)
1012       )
1013     (cond
1014      (components
1015       (princ "<div class=\"container\">
1016 ")
1017       ;; (map-char-attribute
1018       ;;  (lambda (c v)
1019       ;;    (when (every (lambda (p)
1020       ;;                   (ideographic-structure-member p v))
1021       ;;                 components)
1022       ;;      (princ (encode-coding-string
1023       ;;              (ids-find-format-line c v)
1024       ;;              'utf-8-jp-er))
1025       ;;      (princ "<br>\n")
1026       ;;      )
1027       ;;    nil)
1028       ;;  'ideographic-structure)
1029       (when (= (length components) 1)
1030         (www-ids-find-format-line (aref components 0)
1031                                   (char-feature (aref components 0)
1032                                                 'ideographic-structure)))
1033       ;; (dolist (c (ideographic-products-find components))
1034       ;;   (setq is (char-feature c 'ideographic-structure))
1035       ;;   ;; to avoid problems caused by wrong indexes
1036       ;;   (when (every (lambda (c)
1037       ;;                  (ideographic-structure-member c is))
1038       ;;                components)
1039       ;;     (www-ids-find-format-line c is)))
1040       ;; (princ "<ul>\n")
1041       (www-ids-insert-chars-including-components components)
1042       ;; (princ "</ul>\n")
1043       (princ "</div>\n")
1044       )
1045      (t
1046       (princ (encode-coding-string "<div class=\"container mt-4\">
1047 <div class=\"ml-3\">
1048 <p>
1049 \e$B;XDj$7$?ItIJ$rA4$F4^$`4A;z$N0lMw$rI=<($7$^$9!#\e(B
1050 </p>
1051 <p>
1052 CHISE \e$B$GMQ$$$i$l$k<BBV;2>H7A<0!JNc!'\e(B&amp;M-00256;\e$B!K$GItIJ$r;XDj$9$k;v$b$G$-$^$9!#\e(B
1053 </p>
1054 </div>
1055 " 'utf-8-jp-er))
1056       (princ (encode-coding-string "
1057 <p  class=\"ml-0\">
1058 \[Links\]
1059 <ul>
1060 <li><a href=\"http://www.shuiren.org/chuden/toyoshi/syoseki/chise_ids.html\"
1061 >\e$B!V\e(BCHISE IDS FIND\e$B$G4A;z$r8!:w!W\e(B</a> \e$B!=\e(B \e$B;3ED?r?N$5$s!J\e(B<a
1062 href=\"http://www.shuiren.org/\">\e$B?g?MDb\e(B</a>\e$B!K$K$h$k2r@b\e(B
1063 </ul>
1064 <ul>
1065 <li><a href=\"http://www.karitsu.org/tools/firefox_plugin.htm\"
1066 >Firefox \e$BMQ\e(B plugin</a> by \e$B=);3M[0lO:$5$s!J\e(B<a href=\"http://www.karitsu.org/\"
1067 >\e$B2aN)c7\e(B</a>\e$B!K\e(B
1068 </ul>
1069 <ul>
1070 <li><a href=\"http://git.chise.org/gitweb/?p=chise/ids.git;a=blob;f=www/www-ids-find.el\"
1071 >www-ids-find.el (source file (Emacs Lisp part))
1072 <li><a href=\"http://www.chise.org/ids/\"
1073 >\e$B!V\e(BCHISE \e$B4A;z9=B$>pJs%G!<%?%Y!<%9!W\e(B</a>
1074 <li><a href=\"http://fonts.jp/chise_linkmap/\"
1075 >\e$B!V\e(Bchise_linkmap : CHISE \e$B4A;zO"4D?^!W\e(B</a> by \e$B>eCO9(0l$5$s\e(B
1076 <li><a href=\"http://www.chise.org/\"
1077 >CHISE Project</a>
1078 </ul>
1079 <ul>
1080 <li><a href=\"http://coe21.zinbun.kyoto-u.ac.jp/djvuchar\"
1081 >\e$B!VBsK\J8;z%G!<%?%Y!<%9!W\e(B</a> by
1082 <a href=\"http://coe21.zinbun.kyoto-u.ac.jp/\"
1083 >\e$B5~ETBg3X\e(B21\e$B@$5*\e(BCOE\e$B!VEl%"%8%"@$3&$N?MJ8>pJs3X8&5f650i5rE@!W\e(B</a>
1084 <li><a href=\"http://www.unicode.org/\"
1085 >Unicode</a>
1086 </ul>
1087 </p>
1088 </div>
1089 "
1090  'utf-8-jp-er))
1091
1092       ))
1093     (princ "<hr>
1094 <div class=\"container\">
1095 ")
1096     (princ "<div class=\"ml-0\">
1097 Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2015, 2016, 2017, 2020 <a href=\"http://kanji.zinbun.kyoto-u.ac.jp/~tomo/\"
1098 >MORIOKA Tomohiko</a></div>")
1099     (princ
1100      (format
1101       "<div>Powered by <a
1102 href=\"http://www.chise.org/xemacs/\"
1103 >XEmacs CHISE</a> %s.</div>"
1104       (encode-coding-string xemacs-chise-version 'utf-8-jp-er)))
1105     (princ "
1106 </div>
1107 </body>
1108 </html>
1109 ")))