From: tomo Date: Thu, 19 May 2005 07:35:46 +0000 (+0000) Subject: (www-ids-find-format-line): Add links for X-Git-Tag: chise-core-0_22~25 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=fce3ce1d52d14cf3cb38aad9aead7e868ff4e391;p=chise%2Fids.git (www-ids-find-format-line): Add links for http://mousai.kanji.zinbun.kyoto-u.ac.jp/char-desc?CHAR; display glyphs of JC3-hhhh. (www-batch-ids-find): Fix setting for `coded-charset-entity-reference-alist'. --- diff --git a/www/www-ids-find.el b/www/www-ids-find.el index 1de3070..5b43c9c 100644 --- a/www/www-ids-find.el +++ b/www/www-ids-find.el @@ -19,17 +19,39 @@ "~tomo/projects/chise/ids/www/tang-chars.udd") (defun www-ids-find-format-line (c is) - (let ((str (encode-coding-string (format "%c" c) 'utf-8-jp-er)) + (let ((str (encode-coding-string (format "%c" c) 'utf-8-er)) code ucs) - (cond - ((string-match "&CB\\([0-9]+\\);" str) - (setq code (string-to-int (match-string 1 str))) - (princ (format "\"CB%05d\"\n" - code (/ code 1000) code)) - (princ (format "CB%05d" code)) - ) - (t - (princ str))) + (princ + (with-temp-buffer + (cond + ((string-match "&CB\\([0-9]+\\);" str) + (setq code (string-to-int (match-string 1 str))) + (insert "\"CB%05d\"\n" + code (/ code 1000) code)) + (insert (format "CB%05d" code)) + ) + ((string-match "&JC3-\\([0-9A-F]+\\);" str) + (setq code (string-to-int (match-string 1 str) 16)) + (insert "\"JC3-%04X\"\n" + code code)) + (insert (format "JC3-%04X" code)) + ) + (t + (insert "") + (insert str) + (insert "") + )) + (goto-char (point-min)) + (while (search-forward "&" nil t) + (replace-match "&" t 'literal)) + (buffer-string) + )) (princ (or (if (setq ucs (or (char-ucs c) (encode-char c 'ucs))) @@ -77,8 +99,8 @@ (let ((components (car command-line-args-left)) (coded-charset-entity-reference-alist (list* - '((=cbeta "CB" 5 d) - (=jef-china3 "JC3-" 4 X)) + '(=cbeta "CB" 5 d) + '(=jef-china3 "JC3-" 4 X) coded-charset-entity-reference-alist)) is) (setq command-line-args-left (cdr command-line-args-left))