1 ;; -*- coding: utf-8-mcs-er -*-
2 (require 'char-db-util)
4 (setq file-name-coding-system 'utf-8-mcs-er)
7 (concord-assign-genre 'creator@ruimoku "/usr/local/var/ruimoku/db")
8 (concord-assign-genre 'person-name@ruimoku "/usr/local/var/ruimoku/db")
10 (concord-assign-genre 'journal-volume@ruimoku "/usr/local/var/ruimoku/db")
11 (concord-assign-genre 'article@ruimoku "/usr/local/var/ruimoku/db")
12 (concord-assign-genre 'book@ruimoku "/usr/local/var/ruimoku/db")
14 (concord-assign-genre 'classification@ruimoku "/usr/local/var/ruimoku/db")
15 (concord-assign-genre 'region@ruimoku "/usr/local/var/ruimoku/db")
16 (concord-assign-genre 'era@ruimoku "/usr/local/var/ruimoku/db")
17 (concord-assign-genre 'period@ruimoku "/usr/local/var/ruimoku/db")
18 (concord-assign-genre 'journal@ruimoku "/usr/local/var/ruimoku/db")
21 (defvar chise-wiki-view-url "view.cgi")
22 (defvar chise-wiki-edit-url "edit.cgi")
24 (defvar chise-wiki-bitmap-glyphs-url
25 "http://www.chise.org/glyphs")
27 (defvar chise-wiki-glyph-cgi-url
28 "http://www.chise.org/chisewiki/glyph.cgi")
30 (defvar chise-wiki-displayed-features nil)
32 (defun decode-uri-string (string &optional coding-system)
33 (if (> (length string) 0)
37 (mapconcat (lambda (char)
40 (char-to-string char)))
42 (while (string-match "%\\([0-9A-F][0-9A-F]\\)" string i)
43 (setq dest (concat dest
44 (substring string i (match-beginning 0))
47 (string-to-int (match-string 1 string) 16))))
50 (concat dest (substring string i))
53 (defun www-feature-type (feature-name)
54 (or (char-feature-property feature-name 'type)
55 (let ((str (symbol-name feature-name)))
57 ((string-match "\\*note\\(@[^*]+\\)?$" str)
59 ((string-match "\\*sources\\(@[^*]+\\)?$" str)
61 ((string-match "\\*" str)
63 ((string-match "^\\(->\\|<-\\)" str)
65 ((string-match "^ideographic-structure\\(@\\|$\\)" str)
69 (defun www-feature-format (feature-name)
70 (or (char-feature-property feature-name 'format)
72 (setq fn feature-name)
73 (while (and (setq parent (char-feature-name-parent fn))
75 (char-feature-property
79 '((name) " : " (value))))
81 (defun www-feature-value-format (feature-name)
82 (or (char-feature-property feature-name 'value-format)
84 (setq fn feature-name)
85 (while (and (setq parent (char-feature-name-parent fn))
87 (char-feature-property
88 parent 'value-format))))
91 (let ((type (www-feature-type feature-name)))
92 (cond ((eq type 'relation)
93 'space-separated-char-list)
99 (if (find-charset feature-name)
100 (if (and (= (charset-dimension feature-name) 2)
101 (= (charset-chars feature-name) 94))
103 " (" (decimal) ") <" (ku-ten) "> " (prev-char) (next-char))
104 '("0x" (HEX) " (" (decimal) ") " (prev-char) (next-char))))))
106 (defun char-feature-name-at-domain (feature-name domain)
108 (let ((name (symbol-name feature-name)))
110 ((string-match "@[^*]+$" name)
111 (intern (format "%s/%s" name domain))
114 (intern (format "%s@%s" name domain))
118 (defun char-feature-name-parent (feature-name)
119 (let ((name (symbol-name feature-name)))
120 (if (string-match "@[^@/*]+\\(/[^@/*]+\\)*$" name)
121 (intern (substring name 0 (car (last (match-data) 2)))))))
123 (defun char-feature-name-domain (feature-name)
124 (let ((name (symbol-name feature-name)))
125 (if (string-match "@[^@/*]+\\(/[^@/*]+\\)*$" name)
126 (intern (substring name (1+ (match-beginning 0)))))))
128 (defun char-feature-name-sans-versions (feature)
129 (let ((feature-name (symbol-name feature)))
130 (if (string-match "[@/]\\$rev=latest$" feature-name)
131 (intern (substring feature-name 0 (match-beginning 0)))
134 (defun est-object-genre (object)
135 (if (characterp object)
137 (concord-object-genre object)))
139 (defun www-get-feature-value (object feature)
140 (let ((latest-feature (char-feature-name-at-domain feature '$rev=latest)))
143 (mount-char-attribute-table latest-feature)
144 (or (char-feature object latest-feature)
145 (char-feature object feature))
148 (or (condition-case nil
149 (concord-object-get object latest-feature)
152 (concord-object-get object feature)
156 (defun get-previous-code-point (ccs code)
157 (let ((chars (charset-chars ccs))
158 (dim (charset-dimension ccs))
160 mask byte-min byte-max
183 (setq bytes (make-vector dim 0))
185 (aset bytes i (logand (lsh code (* i -8)) mask))
188 (while (and (< i dim)
190 (aset bytes i (1- (aref bytes i)))
191 (< (aref bytes i) byte-min)))
192 (aset bytes i byte-max)
195 (setq dest (aref bytes 0)
198 (setq dest (logior dest (lsh (aref bytes i) (* i 8)))
202 (defun get-next-code-point (ccs code)
203 (let ((chars (charset-chars ccs))
204 (dim (charset-dimension ccs))
206 mask byte-min byte-max
229 (setq bytes (make-vector dim 0))
231 (aset bytes i (logand (lsh code (* i -8)) mask))
234 (while (and (< i dim)
236 (aset bytes i (1+ (aref bytes i)))
237 (> (aref bytes i) byte-max)))
238 (aset bytes i byte-min)
241 (setq dest (aref bytes 0)
244 (setq dest (logior dest (lsh (aref bytes i) (* i 8)))
248 (defun find-previous-defined-code-point (ccs code)
249 (let ((i (get-previous-code-point ccs code))
252 ((eq ccs '=jis-x0208)
253 (setq ccs '=jis-x0208@1990))
254 ((eq ccs '=jis-x0213-1)
255 (setq ccs '=jis-x0213-1@2004)))
258 (null (setq char (decode-char ccs i
259 (unless (eq ccs '=ucs)
261 (setq i (get-previous-code-point ccs i)))
264 (defun find-next-defined-code-point (ccs code)
265 (let ((i (get-next-code-point ccs code))
267 (setq max (+ code 1000))
269 ((eq ccs '=jis-x0208)
270 (setq ccs '=jis-x0208@1990))
271 ((eq ccs '=jis-x0213-1)
272 (setq ccs '=jis-x0213-1@2004)))
275 (null (setq char (decode-char ccs i
276 (unless (eq ccs '=ucs)
278 (setq i (get-next-code-point ccs i)))
282 ;;; @ URI representation
285 (defun www-uri-decode-feature-name (uri-feature)
288 ((string-match "^from\\." uri-feature)
289 (intern (format "<-%s" (substring uri-feature (match-end 0))))
291 ((string-match "^to\\." uri-feature)
292 (intern (format "->%s" (substring uri-feature (match-end 0))))
294 ((string-match "^rep\\." uri-feature)
295 (intern (format "=%s" (substring uri-feature (match-end 0))))
297 ((string-match "^g\\." uri-feature)
298 (intern (format "=>>%s" (substring uri-feature (match-end 0))))
300 ((string-match "^gi\\." uri-feature)
301 (intern (format "=>>>%s" (substring uri-feature (match-end 0))))
303 ((string-match "^gi\\([0-9]+\\)\\." uri-feature)
304 (intern (format "=>>%s%s"
305 (make-string (string-to-int
306 (match-string 1 uri-feature))
308 (substring uri-feature (match-end 0))))
310 ((string-match "^a\\." uri-feature)
311 (intern (format "=>%s" (substring uri-feature (match-end 0))))
313 ((string-match "^a\\([0-9]+\\)\\." uri-feature)
314 (intern (format "%s>%s"
315 (make-string (string-to-int
316 (match-string 1 uri-feature))
318 (substring uri-feature (match-end 0))))
320 ((and (setq feature (intern (format "=>%s" uri-feature)))
321 (find-charset feature))
323 ((and (setq feature (intern (format "=>>%s" uri-feature)))
324 (find-charset feature))
326 ((and (setq feature (intern (format "=>>>%s" uri-feature)))
327 (find-charset feature))
329 ((and (setq feature (intern (format "=%s" uri-feature)))
330 (find-charset feature))
332 (t (intern uri-feature)))))
334 (defun www-uri-encode-feature-name (feature-name)
335 (setq feature-name (symbol-name feature-name))
337 ((string-match "^=\\([^=>]+\\)" feature-name)
338 (concat "rep." (substring feature-name (match-beginning 1)))
340 ((string-match "^=>>\\([^=>]+\\)" feature-name)
341 (concat "g." (substring feature-name (match-beginning 1)))
343 ((string-match "^=>>>\\([^=>]+\\)" feature-name)
344 (concat "gi." (substring feature-name (match-beginning 1)))
346 ((string-match "^=>>\\(>+\\)" feature-name)
348 (length (match-string 1 feature-name))
349 (substring feature-name (match-end 1)))
351 ((string-match "^=>\\([^=>]+\\)" feature-name)
352 (concat "a." (substring feature-name (match-beginning 1)))
354 ((string-match "^\\(=+\\)>" feature-name)
356 (length (match-string 1 feature-name))
357 (substring feature-name (match-end 0)))
359 ((string-match "^->" feature-name)
360 (concat "to." (substring feature-name (match-end 0)))
362 ((string-match "^<-" feature-name)
363 (concat "from." (substring feature-name (match-end 0)))
367 (defun www-uri-make-feature-name-url (uri-feature-name uri-char)
368 (format "%s?feature=%s&char=%s"
369 chise-wiki-view-url uri-feature-name uri-char))
371 (defun www-uri-decode-object (genre char-rep)
374 ((string-match "\\(%3A\\|:\\)" char-rep)
375 (setq ccs (substring char-rep 0 (match-beginning 0))
376 cpos (substring char-rep (match-end 0)))
377 (setq ccs (www-uri-decode-feature-name ccs))
379 ((string-match "^0x" cpos)
381 (string-to-number (substring cpos (match-end 0)) 16))
384 (setq cpos (car (read-from-string cpos)))
386 (if (and (eq genre 'character)
388 (decode-char ccs cpos)
389 (concord-decode-object ccs cpos genre))
392 (setq char-rep (decode-uri-string char-rep 'utf-8-mcs-er))
394 ((eq genre 'character)
395 (when (= (length char-rep) 1)
399 (concord-decode-object
400 '=id (www-uri-decode-feature-name char-rep) 'feature)
403 (concord-decode-object
404 '=id (car (read-from-string char-rep)) genre)
407 (defun www-uri-encode-object (object)
408 (if (characterp object)
409 (if (encode-char object '=ucs)
412 (format "%%%02X" byte))
413 (encode-coding-string (char-to-string object) 'utf-8-mcs-er)
415 (let ((ccs-list '(; =ucs
416 =cns11643-1 =cns11643-2 =cns11643-3
417 =cns11643-4 =cns11643-5 =cns11643-6 =cns11643-7
419 =jis-x0208 =jis-x0208@1990
422 =jis-x0213-1@2000 =jis-x0213-1@2004
423 =jis-x0208@1983 =jis-x0208@1978
424 =zinbun-oracle =>zinbun-oracle
427 =>>jis-x0208 =>>jis-x0213-1
428 =>jis-x0208 =>jis-x0213-1
435 (setq ccs (pop ccs-list))
436 (not (setq ret (encode-char object ccs 'defined-only)))))
439 (www-uri-encode-feature-name ccs)
441 ((and (setq ccs (car (split-char object)))
442 (setq ret (encode-char object ccs)))
444 (www-uri-encode-feature-name ccs)
447 (format "system-char-id:0x%X"
448 (encode-char object 'system-char-id))
450 (format "rep.id:%s" (concord-object-id object))))
452 (defun est-format-object (object)
453 (if (characterp object)
454 (char-to-string object)
455 (format "%s" (concord-object-id object))))
457 (defun www-uri-make-object-url (object &optional uri-object)
460 (est-object-genre object)
462 (www-uri-encode-object object))))
465 ;;; @ Feature name presentation
468 (defun www-format-feature-name-default (feature-name)
472 (symbol-name feature-name)
476 (defun www-format-feature-name-as-metadata (feature-name &optional lang)
477 (let ((str (symbol-name feature-name))
480 ((string-match "\\*[^*]+$" str)
481 (setq base (substring str 0 (match-beginning 0))
482 meta (substring str (match-beginning 0)))
483 (concat (www-format-feature-name* (intern base) lang)
486 (www-format-feature-name-default feature-name)
489 (defun www-format-feature-name-as-rel-to (feature-name)
490 (concat "\u2192" (substring (symbol-name feature-name) 2)))
492 (defun www-format-feature-name-as-rel-from (feature-name)
493 (concat "\u2190" (substring (symbol-name feature-name) 2)))
495 (defun www-format-feature-name-as-CCS (feature-name)
498 (symbol-name feature-name)
500 (dest (upcase (pop rest))))
501 (when (string-match "^=+>*" dest)
502 (setq dest (concat (substring dest 0 (match-end 0))
504 (substring dest (match-end 0)))))
508 (setq dest (concat dest " " (upcase (pop rest)))))
509 (if (string-match "^[0-9]+$" (car rest))
510 (concat dest "-" (car rest))
511 (concat dest " " (upcase (car rest))))
515 (defun www-format-feature-name* (feature-name &optional lang)
516 (let (name fn parent ret)
519 (char-feature-property
521 (intern (format "name@%s" lang))))
522 (char-feature-property
523 feature-name 'name)))
524 ((and (setq name (symbol-name feature-name))
525 (string-match "\\*" name))
526 (www-format-feature-name-as-metadata feature-name lang))
528 (setq fn feature-name)
529 (while (and (setq parent (char-feature-name-parent fn))
532 (char-feature-property
534 (intern (format "name@%s" lang))))
535 (char-feature-property
540 (concat ret (substring (symbol-name feature-name)
541 (length (symbol-name parent)))))
542 ((find-charset feature-name)
543 (www-format-feature-name-as-CCS feature-name))
544 ((string-match "^\\(->\\)" name)
545 (www-format-feature-name-as-rel-to feature-name))
546 ((string-match "^\\(<-\\)" name)
547 (www-format-feature-name-as-rel-from feature-name))
549 (www-format-feature-name-default feature-name)
553 (defun www-format-feature-name (feature-name &optional lang)
554 (www-format-encode-string
555 (www-format-feature-name* feature-name lang)))
561 (defvar www-format-char-img-style "vertical-align:bottom;")
563 (defun www-format-encode-string (string &optional without-tags as-body)
566 (let (plane code start end char variants ret rret)
568 (goto-char (point-min))
569 (while (search-forward "&" nil t)
570 (replace-match "&" nil t)))
571 (goto-char (point-min))
572 (while (search-forward "<" nil t)
573 (replace-match "<" nil t))
574 (goto-char (point-min))
575 (while (search-forward ">" nil t)
576 (replace-match ">" nil t))
578 (encode-coding-region (point-min)(point-max) 'utf-8-mcs-er)
579 (let ((coded-charset-entity-reference-alist
582 '(=cns11643-1 "C1-" 4 X)
583 '(=cns11643-2 "C2-" 4 X)
584 '(=cns11643-3 "C3-" 4 X)
585 '(=cns11643-4 "C4-" 4 X)
586 '(=cns11643-5 "C5-" 4 X)
587 '(=cns11643-6 "C6-" 4 X)
588 '(=cns11643-7 "C7-" 4 X)
590 '(=gb12345 "G1-" 4 X)
591 '(=jis-x0208@1990 "J90-" 4 X)
592 '(=jis-x0212 "JSP-" 4 X)
594 '(=jis-x0208@1997 "J97-" 4 X)
595 '(=jis-x0208@1978 "J78-" 4 X)
596 '(=jis-x0208@1983 "J83-" 4 X)
597 '(=ruimoku-v6 "RUI6-" 4 X)
598 '(=zinbun-oracle "ZOB-" 4 d)
599 '(=jef-china3 "JC3-" 4 X)
600 '(=daikanwa "M-" 5 d)
601 coded-charset-entity-reference-alist)))
602 (encode-coding-region (point-min)(point-max) 'utf-8-mcs-er)
604 (goto-char (point-min))
605 (while (re-search-forward "&CB\\([0-9]+\\);" nil t)
606 (setq code (string-to-int (match-string 1)))
608 (format "<img alt=\"CB%05d\" src=\"%s/cb-gaiji/%02d/CB%05d.gif\"
611 chise-wiki-bitmap-glyphs-url
613 www-format-char-img-style)
616 (goto-char (point-min))
617 (while (re-search-forward "&J\\(78\\|83\\|90\\|97\\|SP\\)-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t)
618 (setq plane (match-string 1)
619 code (string-to-int (match-string 2) 16))
621 (format "<img alt=\"J%s-%04X\" src=\"%s/JIS-%s/%02d-%02d.gif\"
624 chise-wiki-bitmap-glyphs-url
627 (- (logand code 255) 32)
628 www-format-char-img-style)
631 (goto-char (point-min))
632 (while (re-search-forward "&G\\([01]\\)-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t)
633 (setq plane (string-to-int (match-string 1))
634 code (string-to-int (match-string 2) 16))
636 (format "<img alt=\"GB%d-%04X\" src=\"%s/GB%d/%02d-%02d.gif\"
639 chise-wiki-bitmap-glyphs-url
642 (- (logand code 255) 32)
643 www-format-char-img-style)
646 (goto-char (point-min))
647 (while (re-search-forward "&C\\([1-7]\\)-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t)
648 (setq plane (string-to-int (match-string 1))
649 code (string-to-int (match-string 2) 16))
651 (format "<img alt=\"CNS%d-%04X\" src=\"%s/CNS%d/%04X.gif\"
654 chise-wiki-bitmap-glyphs-url
656 www-format-char-img-style)
659 (goto-char (point-min))
660 (while (re-search-forward "&JC3-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t)
661 (setq code (string-to-int (match-string 1) 16))
663 (format "<img alt=\"JC3-%04X\" src=\"http://kanji.zinbun.kyoto-u.ac.jp/db/CHINA3/Gaiji/%04x.gif\">"
667 (goto-char (point-min))
668 (while (re-search-forward "&\\(A-\\)?ZOB-\\([0-9]+\\);" nil t)
669 (setq code (string-to-int (match-string 2)))
671 (format "<img alt=\"ZOB-%04d\" src=\"%s/ZOB-1968/%04d.png\"
672 style=\"vertical-align:middle\">"
674 chise-wiki-bitmap-glyphs-url
676 www-format-char-img-style)
679 (goto-char (point-min))
680 (while (re-search-forward "&\\(G-\\)?GT-\\([0-9]+\\);" nil t)
681 (setq code (string-to-int (match-string 2)))
683 (format "<img alt=\"GT-%05d\" src=\"%s?char=GT-%05d\"
686 chise-wiki-glyph-cgi-url
688 www-format-char-img-style)
691 (goto-char (point-min))
692 (while (re-search-forward "&\\(G-\\)?GT-K\\([0-9]+\\);" nil t)
693 (setq code (string-to-int (match-string 2)))
695 (format "<img alt=\"GT-K%05d\" src=\"%s?char=GT-K%05d\"
698 chise-wiki-glyph-cgi-url
700 www-format-char-img-style)
703 (goto-char (point-min))
704 (while (re-search-forward "&B-\\([0-9A-F]+\\);" nil t)
705 (setq code (string-to-int (match-string 1) 16))
707 (format "<img alt=\"B-%04X\" src=\"%s?char=B-%04X\"
710 chise-wiki-glyph-cgi-url
712 www-format-char-img-style)
715 (goto-char (point-min))
716 (while (re-search-forward "&CDP-\\([0-9A-F]+\\);" nil t)
717 (setq code (string-to-int (match-string 1) 16))
719 (format "<img alt=\"CDP-%04X\" src=\"%s?char=CDP-%04X\"
722 chise-wiki-glyph-cgi-url
724 www-format-char-img-style)
727 (goto-char (point-min))
728 (while (re-search-forward "&RUI6-\\([0-9A-F]+\\);" nil t)
729 (setq code (string-to-int (match-string 1) 16))
731 (format "<img alt=\"RUI6-%04X\" src=\"%s?char=RUI6-%04X\"
732 style=\"vertical-align:middle\">"
734 chise-wiki-glyph-cgi-url
736 www-format-char-img-style)
739 (goto-char (point-min))
740 (while (re-search-forward "&\\(UU\\+\\|U-\\)\\([0-9A-F]+\\);" nil t)
741 (setq code (string-to-int (match-string 2) 16))
743 (format "<img alt=\"UU+%04X\" src=\"http://www.unicode.org/cgi-bin/refglyph?24-%04X\"
744 style=\"vertical-align:middle\">"
747 www-format-char-img-style)
750 (goto-char (point-min))
751 (while (re-search-forward "&MCS-\\([0-9A-F]+\\);" nil t)
752 (setq code (string-to-int (match-string 1) 16))
753 (setq start (match-beginning 0)
755 (setq char (decode-char 'system-char-id code))
758 (or (www-get-feature-value char '->subsumptive)
759 (www-get-feature-value char '->denotational)))
762 (setq ret (www-format-encode-string
763 (char-to-string (car variants))))
764 (string-match "&MCS-\\([0-9A-F]+\\);" ret))
765 (setq variants (cdr variants)))
767 (unless (string-match "&MCS-\\([0-9A-F]+\\);" ret)
769 (delete-region start end)
772 ((setq ret (or (www-get-feature-value char 'ideographic-combination)
773 (www-get-feature-value char 'ideographic-structure)))
778 (if (characterp (setq rret (find-char ch)))
781 (www-format-encode-string
782 (char-to-string ch) without-tags)
783 (www-format-encode-string
784 (format "%S" ch) without-tags)))
788 (delete-region start end)
792 ;; (goto-char (point-min))
793 ;; (while (search-forward ">-" nil t)
794 ;; (replace-match "&GT-" t 'literal))
797 (defun www-html-display-text (text)
801 (goto-char (point-min))
802 (while (search-forward "<" nil t)
803 (replace-match "<" nil t))
804 (goto-char (point-min))
805 (while (search-forward ">" nil t)
806 (replace-match ">" nil t))
807 (goto-char (point-min))
808 (while (re-search-forward "\\[\\[\\([^]|[]+\\)|\\([^][]+\\)\\]\\]" nil t)
810 (format "<a href=\"%s\">%s</a>"
814 (encode-coding-region (point-min)(point-max) 'utf-8-mcs-er)
815 (goto-char (point-min))
816 (while (search-forward ">-" nil t)
817 (replace-match "&GT-" nil t))
820 (defun www-html-display-paragraph (text)
822 (www-html-display-text text)
829 (defvar coded-charset-GlyphWiki-id-alist
831 (=ucs@JP "u" 4 x nil)
832 (=ucs@jis "u" 4 x nil)
833 (=ucs@gb "u" 4 x "-g")
834 (=ucs@cns "u" 4 x "-t")
835 (=ucs@ks "u" 4 x "-k")
836 (=ucs@iso "u" 4 x "-u")
837 (=ucs@unicode "u" 4 x "-us")
838 (=adobe-japan1-6 "aj1-" 5 d nil)
840 (=big5-cdp "cdp-" 4 x nil)
841 (=cbeta "cb" 5 d nil)
842 (=jis-x0208@1978/1pr "j78-" 4 x nil)
843 (=jis-x0208@1978/-4pr "j78-" 4 x nil)
844 (=jis-x0208@1978 "j78-" 4 x nil)
845 (=jis-x0208@1983 "j83-" 4 x nil)
846 (=jis-x0208@1990 "j90-" 4 x nil)
847 (=jis-x0212 "jsp-" 4 x nil)
848 (=jis-x0213-1@2000 "jx1-2000-" 4 x nil)
849 (=jis-x0213-1@2004 "jx1-2004-" 4 x nil)
850 (=jis-x0213-2 "jx2-" 4 x nil)
851 (=cns11643-1 "c1-" 4 x nil)
852 (=cns11643-2 "c2-" 4 x nil)
853 (=cns11643-3 "c3-" 4 x nil)
854 (=cns11643-4 "c4-" 4 x nil)
855 (=cns11643-5 "c5-" 4 x nil)
856 (=cns11643-6 "c6-" 4 x nil)
857 (=cns11643-7 "c7-" 4 x nil)
858 (=daikanwa "dkw-" 5 d nil)
859 (=gt-k "gt-k" 5 d nil)
860 (=jef-china3 "jc3-" 4 x nil)
862 (=ks-x1001 "k0-" 4 x nil)
865 (defun char-GlyphWiki-id (char)
866 (let ((rest coded-charset-GlyphWiki-id-alist)
869 (setq spec (pop rest))
870 (null (setq ret (char-feature char (car spec))))))
873 (and (memq (car spec) '(=ucs@unicode '=ucs@iso))
875 ((and (or (encode-char char '=jis-x0208@1990)
876 (encode-char char '=jis-x0212)
877 (encode-char char '=jis-x0213-1))
878 (setq code (encode-char char '=ucs@jis)))
879 (format "u%04x" code)
881 ((and (or (encode-char char '=gb2312)
882 (encode-char char '=gb12345))
883 (setq code (encode-char char '=ucs@gb)))
884 (format "u%04x-g" code)
886 ((and (or (encode-char char '=cns11643-1)
887 (encode-char char '=cns11643-2)
888 (encode-char char '=cns11643-3)
889 (encode-char char '=cns11643-4)
890 (encode-char char '=cns11643-5)
891 (encode-char char '=cns11643-6)
892 (encode-char char '=cns11643-7))
893 (setq code (encode-char char '=ucs@cns)))
894 (format "u%04x-t" code)
896 ((and (encode-char char '=ks-x1001)
897 (setq code (encode-char char '=ucs@ks)))
898 (format "u%04x-k" code)
900 (format (format "%s%%0%d%s%s"
904 (or (nth 4 spec) ""))
911 (provide 'cwiki-common)
913 ;;; cwiki-common.el ends here