From: tomo Date: Wed, 6 Aug 2003 04:31:31 +0000 (+0000) Subject: (ids-dump-insert-big5): New function. X-Git-Tag: ids-0_0-1~91 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91cb2c63ba9fe507a44135fea304af49a2045acd;p=chise%2Fids.git (ids-dump-insert-big5): New function. (ids-dump-big5-cdp): New function. --- diff --git a/ids-dump.el b/ids-dump.el index ceaa578..0f33074 100644 --- a/ids-dump.el +++ b/ids-dump.el @@ -1,6 +1,6 @@ ;;; ids-dump.el --- Dump utility of IDS-* files -;; Copyright (C) 2002 MORIOKA Tomohiko +;; Copyright (C) 2002,2003 MORIOKA Tomohiko ;; Author: MORIOKA Tomohiko ;; Keywords: IDS, IDC, Ideographs, UCS, Unicode @@ -147,6 +147,42 @@ ""))) (setq cell (1+ cell))))) +(defun ids-dump-insert-big5 (ccs prefix) + (let ((h #x81) + l code chr structure) + (while (<= h #xFE) + (setq l #x40) + (while (<= l #x7E) + (setq chr (make-char ccs h l)) + (setq structure nil) + (when (setq structure + (get-char-attribute chr 'ideographic-structure)) + (insert + (format "%s%02X%02X\t%c\t%s\n" + prefix h l + (decode-builtin-char ccs + (logior (lsh h 8) l)) + (or (ids-format-list + (get-char-attribute chr 'ideographic-structure)) + "")))) + (setq l (1+ l))) + (setq l #xA1) + (while (<= l #xFE) + (setq chr (make-char ccs h l)) + (setq structure nil) + (when (setq structure + (get-char-attribute chr 'ideographic-structure)) + (insert + (format "%s%02X%02X\t%c\t%s\n" + prefix h l + (decode-builtin-char ccs + (logior (lsh h 8) l)) + (or (ids-format-list + (get-char-attribute chr 'ideographic-structure)) + "")))) + (setq l (1+ l))) + (setq h (1+ h))))) + (defun ids-dump-range (file path func &rest args) (with-temp-buffer (let* ((coding-system-for-write 'utf-8-mcs-er)) @@ -324,6 +360,13 @@ (ids-dump-range "IDS-JIS-X0208-1990.txt" filename #'ids-dump-insert-jis-x0208-1990)) +;;;###autoload +(defun ids-dump-big5-cdp (filename) + (interactive "Fdump IDS-CDP : ") + (ids-dump-range "IDS-CDP.txt" filename + #'ids-dump-insert-big5 + '=big5-cdp "CDP-")) + ;;; @ End. ;;;