1 ;;; dump-tables.el --- Dump utility of mapping tables
3 ;; Copyright (C) 2002 MORIOKA Tomohiko
5 ;; Author: MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
6 ;; Keywords: Ideographs, Character Database, UTF-2000, UCS, Unicode
8 ;; This file is a part of tomoyo-tools.
10 ;; This program is free software; you can redistribute it and/or
11 ;; modify it under the terms of the GNU General Public License as
12 ;; published by the Free Software Foundation; either version 2, or (at
13 ;; your option) any later version.
15 ;; This program is distributed in the hope that it will be useful, but
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ;; General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with this program; see the file COPYING. If not, write to
22 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
28 (defun dump-jis-x0208-1990-to-ucs-table (filename)
29 (interactive "Fdump J90-to-UCS : ")
30 (if (file-directory-p filename)
31 (setq filename (expand-file-name "J90-to-UCS.txt" filename)))
38 (when (and (setq chr (make-char 'japanese-jisx0208-1990 row cell))
39 (setq ucs (or (get-char-attribute chr 'ucs)
40 (get-char-attribute chr '=>ucs)
41 (get-char-attribute chr '->ucs))))
42 (setq ucs-j (or (get-char-attribute chr 'ucs-jis)
43 (get-char-attribute chr '=>ucs-jis)))
44 (insert (format "J90-%02X%02X" row cell))
46 (insert (format "\tJU+%04X\t" ucs-j))
48 (insert (format (if (<= ucs #xFFFF)
52 (setq cell (1+ cell)))
54 (write-region (point-min)(point-max) filename)))
57 (defun dump-jis-x0212-to-ucs-table (filename)
58 (interactive "Fdump JSP-to-UCS : ")
59 (if (file-directory-p filename)
60 (setq filename (expand-file-name "JSP-to-UCS.txt" filename)))
67 (when (and (setq chr (make-char 'japanese-jisx0212 row cell))
68 (setq ucs (or (get-char-attribute chr 'ucs)
69 (get-char-attribute chr '=>ucs)
70 (get-char-attribute chr '->ucs))))
71 (setq ucs-j (or (get-char-attribute chr 'ucs-jis)
72 (get-char-attribute chr '=>ucs-jis)))
73 (insert (format "JSP-%02X%02X" row cell))
75 (insert (format "\tJU+%04X\t" ucs-j))
77 (insert (format (if (<= ucs #xFFFF)
81 (setq cell (1+ cell)))
83 (write-region (point-min)(point-max) filename)))
86 (defun dump-jis-x0213-1-to-ucs-table (filename)
87 (interactive "Fdump JX1-to-UCS : ")
88 (if (file-directory-p filename)
89 (setq filename (expand-file-name "JX1-to-UCS.txt" filename)))
96 (when (and (setq chr (make-char 'japanese-jisx0213-1 row cell))
97 (setq ucs (or (get-char-attribute chr 'ucs)
98 (get-char-attribute chr '=>ucs)
99 (get-char-attribute chr '->ucs))))
100 (setq ucs-j (or (get-char-attribute chr 'ucs-jis)
101 (get-char-attribute chr '=>ucs-jis)))
102 (insert (format "JX1-%02X%02X" row cell))
104 (insert (format "\tJU+%04X\t" ucs-j))
106 (insert (format (if (<= ucs #xFFFF)
110 (setq cell (1+ cell)))
111 (setq row (1+ row))))
112 (write-region (point-min)(point-max) filename)))
115 (defun dump-jis-x0213-2-to-ucs-table (filename)
116 (interactive "Fdump JX2-to-UCS : ")
117 (if (file-directory-p filename)
118 (setq filename (expand-file-name "JX2-to-UCS.txt" filename)))
125 (when (and (setq chr (make-char 'japanese-jisx0213-2 row cell))
126 (setq ucs (or (get-char-attribute chr 'ucs)
127 (get-char-attribute chr '=>ucs)
128 (get-char-attribute chr '->ucs))))
129 (setq ucs-j (or (get-char-attribute chr 'ucs-jis)
130 (get-char-attribute chr '=>ucs-jis)))
131 (insert (format "JX2-%02X%02X" row cell))
133 (insert (format "\tJU+%04X\t" ucs-j))
135 (insert (format (if (<= ucs #xFFFF)
139 (setq cell (1+ cell)))
140 (setq row (1+ row))))
141 (write-region (point-min)(point-max) filename)))
144 (defun dump-cns-11643-3-to-ucs-table (filename)
145 (interactive "Fdump C3-to-UCS : ")
146 (if (file-directory-p filename)
147 (setq filename (expand-file-name "C3-to-UCS.txt" filename)))
150 cell chr ucs ucs-cns)
154 (when (and (setq chr (make-char 'chinese-cns11643-3 row cell))
155 (setq ucs (or (get-char-attribute chr 'ucs)
156 (get-char-attribute chr '=>ucs)
157 (get-char-attribute chr '->ucs))))
158 (setq ucs-cns (or (get-char-attribute chr 'ucs-cns)
159 (get-char-attribute chr '=>ucs-cns)))
160 (insert (format "C3-%02X%02X" row cell))
162 (insert (format "\tCU+%04X\t" ucs-cns))
164 (insert (format (if (<= ucs #xFFFF)
168 (setq cell (1+ cell)))
169 (setq row (1+ row))))
170 (write-region (point-min)(point-max) filename)))
173 (defun dump-cns-11643-4-to-ucs-table (filename)
174 (interactive "Fdump C4-to-UCS : ")
175 (if (file-directory-p filename)
176 (setq filename (expand-file-name "C4-to-UCS.txt" filename)))
179 cell chr ucs ucs-cns)
183 (when (and (setq chr (make-char 'chinese-cns11643-4 row cell))
184 (setq ucs (or (get-char-attribute chr 'ucs)
185 (get-char-attribute chr '=>ucs)
186 (get-char-attribute chr '->ucs))))
187 (setq ucs-cns (or (get-char-attribute chr 'ucs-cns)
188 (get-char-attribute chr '=>ucs-cns)))
189 (insert (format "C4-%02X%02X" row cell))
191 (insert (format "\tCU+%04X\t" ucs-cns))
193 (insert (format (if (<= ucs #xFFFF)
197 (setq cell (1+ cell)))
198 (setq row (1+ row))))
199 (write-region (point-min)(point-max) filename)))
202 (defun dump-big5-to-ucs-table (filename)
203 (interactive "Fdump B-to-UCS : ")
204 (if (file-directory-p filename)
205 (setq filename (expand-file-name "B-to-UCS.txt" filename)))
208 cell chr ucs ucs-big5)
212 (when (and (setq chr (make-char 'chinese-big5 row cell))
213 (setq ucs (or (get-char-attribute chr 'ucs)
214 (get-char-attribute chr '=>ucs)
215 (get-char-attribute chr '->ucs))))
216 (setq ucs-big5 (or (get-char-attribute chr 'ucs-big5)
217 (get-char-attribute chr '=>ucs-big5)))
218 (insert (format "B-%02X%02X" row cell))
220 (insert (format "\tBU+%04X\t" ucs-big5))
222 (insert (format (if (<= ucs #xFFFF)
226 (setq cell (1+ cell)))
227 (setq row (1+ row))))
228 (write-region (point-min)(point-max) filename)))
231 (defun dump-jef-china3-to-ucs-table (filename)
232 (interactive "Fdump JC3-to-UCS : ")
233 (if (file-directory-p filename)
234 (setq filename (expand-file-name "JC3-to-UCS.txt" filename)))
241 (when (and (setq chr (make-char 'china3-jef row cell))
242 (setq ucs (or (get-char-attribute chr 'ucs)
243 (get-char-attribute chr '=>ucs))))
244 (insert (format "JC3-%02X%02X\t" row cell))
245 (insert (format (if (<= ucs #xFFFF)
249 (setq cell (1+ cell)))
250 (setq row (1+ row))))
251 (write-region (point-min)(point-max) filename)))
257 (provide 'dump-tables)
259 ;;; dump-tables.el ends here