From: tomo Date: Mon, 25 Nov 2002 09:23:53 +0000 (+0000) Subject: (dump-jis-x0208-1990-to-ucs-table): Don't print JU+XXXX if the X-Git-Tag: chise-base-0_23~66 X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Ftomoyo-tools.git;a=commitdiff_plain;h=c6317b27c18af81247fd4a8271bd78dd1213140f (dump-jis-x0208-1990-to-ucs-table): Don't print JU+XXXX if the corresponding UCS map has the same code point. (dump-jis-x0212-to-ucs-table): Likewise. (dump-jis-x0213-1-to-ucs-table): Don't print JIS X 0208:1990 code points. (dump-cns-11643-3-to-ucs-table): Don't print CU+XXXX if the corresponding UCS map has the same code point. (dump-jef-china3-to-ucs-table): Fixed. (dump-cbeta-to-ucs-table): New function. --- diff --git a/dump-tables.el b/dump-tables.el index 8531e53..b694536 100644 --- a/dump-tables.el +++ b/dump-tables.el @@ -42,7 +42,7 @@ (setq ucs-j (or (get-char-attribute chr 'ucs-jis) (get-char-attribute chr '=>ucs-jis))) (insert (format "J90-%02X%02X" row cell)) - (if ucs-j + (if (and ucs-j (/= ucs-j ucs)) (insert (format "\tJU+%04X\t" ucs-j)) (insert "\t ")) (insert (format (if (<= ucs #xFFFF) @@ -71,7 +71,7 @@ (setq ucs-j (or (get-char-attribute chr 'ucs-jis) (get-char-attribute chr '=>ucs-jis))) (insert (format "JSP-%02X%02X" row cell)) - (if ucs-j + (if (and ucs-j (/= ucs-j ucs)) (insert (format "\tJU+%04X\t" ucs-j)) (insert "\t ")) (insert (format (if (<= ucs #xFFFF) @@ -94,6 +94,7 @@ (setq cell 33) (while (< cell 127) (when (and (setq chr (make-char 'japanese-jisx0213-1 row cell)) + (not (encode-char chr 'japanese-jisx0208-1990 t)) (setq ucs (or (get-char-attribute chr 'ucs) (get-char-attribute chr '=>ucs) (get-char-attribute chr '->ucs)))) @@ -158,7 +159,7 @@ (setq ucs-cns (or (get-char-attribute chr 'ucs-cns) (get-char-attribute chr '=>ucs-cns))) (insert (format "C3-%02X%02X" row cell)) - (if ucs-cns + (if (and ucs-cns (/= ucs-cns ucs)) (insert (format "\tCU+%04X\t" ucs-cns)) (insert "\t ")) (insert (format (if (<= ucs #xFFFF) @@ -237,7 +238,7 @@ cell chr ucs) (while (<= row #x9F) (setq cell #xA1) - (while (< cell #xFE) + (while (<= cell #xFE) (when (and (setq chr (make-char 'china3-jef row cell)) (setq ucs (or (get-char-attribute chr 'ucs) (get-char-attribute chr '=>ucs)))) @@ -250,6 +251,26 @@ (setq row (1+ row)))) (write-region (point-min)(point-max) filename))) +;;;###autoload +(defun dump-cbeta-to-ucs-table (filename) + (interactive "Fdump CBETA-to-UCS : ") + (if (file-directory-p filename) + (setq filename (expand-file-name "CBETA-to-UCS.txt" filename))) + (with-temp-buffer + (let ((i 1) + chr ucs) + (while (<= i 20000) + (when (and (setq chr (decode-char 'ideograph-cbeta i)) + (setq ucs (or (get-char-attribute chr 'ucs) + (get-char-attribute chr '=>ucs)))) + (insert (format "CB%05d\t" i)) + (insert (format (if (<= ucs #xFFFF) + "U+%04X\n" + "U-%08X\n") + ucs))) + (setq i (1+ i)))) + (write-region (point-min)(point-max) filename))) + ;;; @ End. ;;;