From: tomo Date: Wed, 2 Jul 2003 11:48:57 +0000 (+0000) Subject: (dump-jis2ucsdkw): New function. X-Git-Tag: chise-base-0_23~48 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d48e992943356fbf16ddf97475eedbd3ab29eeb0;p=chise%2Ftomoyo-tools.git (dump-jis2ucsdkw): New function. --- diff --git a/dump-tables.el b/dump-tables.el index 1134b54..eed1f81 100644 --- a/dump-tables.el +++ b/dump-tables.el @@ -195,6 +195,71 @@ (setq i (1+ i)))) (write-region (point-min)(point-max) filename))) +;;;###autoload +(defun dump-jis2ucsdkw (filename) + (interactive "Fdump jis2ucsdkw : ") + (if (file-directory-p filename) + (setq filename (expand-file-name "jis2ucsdkw.txt" filename))) + (with-temp-buffer + (let ((row 33) + cell chr ucs-j md) + (while (< row 127) + (setq cell 33) + (while (< cell 127) + (when (and (setq chr (make-char 'japanese-jisx0213-1 row cell)) + (setq ucs-j + (or (encode-char chr '=ucs@jis-2000 'defined-only) + (get-char-attribute chr '=>ucs@jis-2000) + (get-char-attribute chr '=>ucs@jis) + (get-char-attribute chr '=>ucs))) + (or (and (<= #x3400 ucs-j) (<= ucs-j #x9FA5)) + (and (<= #xF900 ucs-j) (<= ucs-j #xFA6F)) + (<= #x20000 ucs-j))) + (insert (format "J1-%02d%02d" (- row 32)(- cell 32))) + (if ucs-j + (insert (format " U+%05X" ucs-j)) + (insert " ")) + (setq md (char-daikanwa chr)) + (cond ((integerp md) + (insert (format " D%05d.0\n" md))) + ((eq (car md) 'ho) + (insert (format " DHO%03d\n" (nth 1 md)))) + (md + (insert (format " D%05d.%d\n" (car md)(nth 1 md)))) + (t + (insert "\n"))) + ) + (setq cell (1+ cell))) + (setq row (1+ row))) + (setq row 33) + (while (< row 127) + (setq cell 33) + (while (< cell 127) + (when (and (setq chr (make-char 'japanese-jisx0213-2 row cell)) + (setq ucs-j + (or (encode-char chr '=ucs@jis-2000 'defined-only) + (get-char-attribute chr '=>ucs@jis-2000) + (get-char-attribute chr '=>ucs@jis) + (get-char-attribute chr '=>ucs)))) + (insert (format "J2-%02d%02d" (- row 32)(- cell 32))) + (if ucs-j + (insert (format " U+%05X" ucs-j)) + (insert " ")) + (setq md (char-daikanwa chr)) + (cond ((integerp md) + (insert (format " D%05d.0\n" md))) + ((eq (car md) 'ho) + (insert (format " DHO%03d\n" (nth 1 md)))) + (md + (insert (format " D%05d.%d\n" (car md)(nth 1 md)))) + (t + (insert "\n"))) + ) + (setq cell (1+ cell))) + (setq row (1+ row))) + ) + (write-region (point-min)(point-max) filename))) + ;;; @ End. ;;;