f9a7e2c39b7249f6ce6b0c9576ff0867be8de014
[chise/xemacs-chise.git.1] / lisp / mule / mule-conf.el
1 ;;; mule-conf.el --- configure multilingual environment
2
3 ;; Copyright (C) 1995,1999 Electrotechnical Laboratory, JAPAN.
4 ;; Licensed to the Free Software Foundation.
5 ;; Copyright (C) 1997,1999,2000,2002,2003 MORIOKA Tomohiko
6
7 ;; Keywords: mule, multilingual, character set, coding system
8
9 ;; This file is part of XEmacs.
10
11 ;; XEmacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; any later version.
15
16 ;; XEmacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 ;; GNU General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with XEmacs; see the file COPYING.  If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
25
26 ;;; Code:
27
28 (define-charset-alias 'japanese-jisx0208-1978   '=jis-x0208-1978)
29 (define-charset-alias 'japanese-jisx0208        '=jis-x0208-1983)
30
31 ;; PinYin-ZhuYin
32 (make-charset 'sisheng "PinYin-ZhuYin"
33               '(registry "sisheng_cwnn\\|OMRON_UDC_ZH"
34                 dimension 1
35                 chars 94
36                 final ?0
37                 graphic 0
38                 ))
39
40 ;; Lao script.
41 ;; ISO10646's 0x0E80..0x0EDF are mapped to 0x20..0x7F.
42 (make-charset 'lao "Lao script"
43               '(registry "MuleLao-1"
44                 dimension 1
45                 chars 94
46                 final ?1
47                 graphic 1))
48
49 ;; IPA (International Phonetic Alphabet)
50 (make-charset 'ipa "International Phonetic Alphabet"
51               '(registry "MuleIPA"
52                 dimension 1
53                 chars 96
54                 final ?0
55                 graphic 1))
56
57 ;; Ethiopic
58 (make-charset 'ethiopic "Ethiopic"
59               '(registry "Ethio"
60                 dimension 2
61                 chars 94
62                 final ?3
63                 graphic 0
64                 ))
65
66 ;; ISO-IR-165 (CCITT Extended GB)
67 ;;    It is based on CCITT Recommendation T.101, includes GB 2312-80 +
68 ;;    GB 8565-88 table A4 + 293 characters.
69 (make-charset '=iso-ir165
70               "ISO-IR-165 (CCITT Extended GB; Chinese simplified)"
71               '(iso-ir 165
72                        dimension 2
73                        chars 94
74                        final ?E
75                        registry "isoir165"
76                        graphic 0))
77 (define-charset-alias 'chinese-isoir165 '=iso-ir165)
78
79 ;; CNS11643 Plane3 thru Plane7
80 ;; These represent more and more obscure Chinese characters.
81 ;; By the time you get to Plane 7, we're talking about characters
82 ;; that appear once in some ancient manuscript and whose meaning
83 ;; is unknown.
84
85 (flet
86     ((make-chinese-cns11643-charset
87       (name iso-ir plane final)
88       (make-charset
89        name (concat "CNS 11643 Plane " plane " (Chinese traditional)")
90        `(iso-ir ,iso-ir
91          registry 
92          ,(concat "CNS11643[.-]\\(.*[.-]\\)?" plane "$")
93          dimension 2
94          chars 94
95          final ,final
96          graphic 0))
97       ))
98   (make-chinese-cns11643-charset 'chinese-cns11643-3 183 "3" ?I)
99   (make-chinese-cns11643-charset 'chinese-cns11643-4 184 "4" ?J)
100   (make-chinese-cns11643-charset 'chinese-cns11643-5 185 "5" ?K)
101   (make-chinese-cns11643-charset 'chinese-cns11643-6 186 "6" ?L)
102   (make-chinese-cns11643-charset 'chinese-cns11643-7 187 "7" ?M)
103   )
104
105 ;; JIS X 0213:2000
106 (if (featurep 'utf-2000)
107     (progn
108       (make-charset
109        '=jis-x0213-1-2000
110        "JIS X 0213:2000 Plain 1"
111        '(iso-ir 228
112                 registry "jisx0213\\(\\.2000\\)-1"
113                 dimension 2
114                 chars 94
115                 mother =jis-x0208-1990
116                 final ?O
117                 graphic 0))
118       (make-charset
119        '=jis-x0213-2-2000
120        "JIS X 0213:2000 Plain 2"
121        '(iso-ir 229
122                 registry "jisx0213\\(\\.2000\\)-2"
123                 dimension 2
124                 chars 94
125                 final ?P
126                 graphic 0))
127       (define-charset-alias 'japanese-jisx0213-1 '=jis-x0213-1-2000)
128       (define-charset-alias 'japanese-jisx0213-2 '=jis-x0213-2-2000)
129       )
130   (make-charset
131    'japanese-jisx0213-1
132    "JIS X 0213:2000 Plain 1"
133    '(registry "jisx0213\\(\\.2000\\)-1"
134               dimension 2
135               chars 94
136               final ?O
137               graphic 0))
138   (make-charset
139    'japanese-jisx0213-2
140    "JIS X 0213:2000 Plain 2"
141    '(registry "jisx0213\\(\\.2000\\)-2"
142               dimension 2
143               chars 94
144               final ?P
145               graphic 0))
146   )
147
148 (when (featurep 'utf-2000)
149   (define-charset-alias 'ucs '=ucs)
150   (define-charset-alias 'japanese-jisx0208-1990 '=jis-x0208-1990)
151   (make-charset '=ucs@gb
152                 "UCS for GB"
153                 `(long-name     "ISO/IEC 10646 for GB"
154                   chars         256
155                   dimension     3
156                   columns       2
157                   graphic       2
158                   direction     l2r
159                   mother        =ucs))
160   (define-charset-alias 'ucs-gb '=ucs@gb)
161   (make-charset '=ucs@cns
162                 "UCS for CNS"
163                 `(long-name     "ISO/IEC 10646 for CNS 11643"
164                   chars         256
165                   dimension     3
166                   columns       2
167                   graphic       2
168                   direction     l2r
169                   mother        =ucs))
170   (define-charset-alias 'ucs-cns '=ucs@cns)
171   (make-charset '=ucs@jis
172                 "UCS for JIS"
173                 `(long-name     "ISO/IEC 10646 for JIS X0208/0212/0213"
174                   chars         256
175                   dimension     3
176                   columns       2
177                   graphic       2
178                   direction     l2r
179                   mother        =ucs))
180   (define-charset-alias 'ucs-jis '=ucs@jis)
181   (make-charset '=ucs@jis-1990
182                 "UCS for JIS:1990"
183                 `(long-name     "ISO/IEC 10646 for JIS X 0208/0212:1990"
184                   chars         256
185                   dimension     3
186                   columns       2
187                   graphic       2
188                   direction     l2r
189                   mother        ucs-jis))
190   (define-charset-alias '=ucs-jis-1990 '=ucs@jis-1990)
191   (make-charset '=ucs@jis-2000
192                 "UCS for JIS:2000"
193                 `(long-name     "ISO/IEC 10646 for JIS X 0213:2000"
194                   chars         256
195                   dimension     3
196                   columns       2
197                   graphic       2
198                   direction     l2r
199                   mother        ucs-jis))
200   (define-charset-alias '=ucs-jis-2000 '=ucs@jis-2000)
201   (make-charset '=ucs@ks
202                 "UCS for KS"
203                 `(long-name     "ISO/IEC 10646 for Korean Standards"
204                   chars         256
205                   dimension     3
206                   columns       2
207                   graphic       2
208                   direction     l2r
209                   mother        =ucs))
210   (define-charset-alias 'ucs-ks '=ucs@ks)
211   (make-charset '=ucs@big5
212                 "UCS for Big5"
213                 `(long-name     "ISO/IEC 10646 for Big5"
214                   chars         256
215                   dimension     3
216                   columns       2
217                   graphic       2
218                   direction     l2r
219                   mother        =ucs))
220   (define-charset-alias 'ucs-big5 '=ucs@big5)
221
222   (make-charset 'ideograph-daikanwa
223                 "Daikanwa"
224                 `(long-name     "Daikanwa dictionary (revised version 2)"
225                   chars         256
226                   dimension     2
227                   columns       2
228                   graphic       2
229                   direction     l2r
230                   registry      "Daikanwa\\(\\.[0-9]+\\)?-3"
231                   min-code      #xE00000
232                   max-code      ,(+ #xE00000 50100)
233                   code-offset   #xE00000))
234
235   (make-charset '=daikanwa-rev1
236                 "Daikanwa Rev."
237                 `(long-name     "Daikanwa dictionary (revised version)"
238                   chars         256
239                   dimension     2
240                   columns       2
241                   graphic       2
242                   direction     l2r
243                   registry      "Daikanwa\\(\\.[0-9]+\\)?-2"))
244   (define-charset-alias 'ideograph-daikanwa-2 '=daikanwa-rev1)
245
246   (make-charset '=daikanwa-rev2
247                 "Daikanwa"
248                 `(long-name     "Daikanwa dictionary (revised version 2)"
249                   chars         256
250                   dimension     2
251                   columns       2
252                   graphic       2
253                   direction     l2r
254                   registry      "Daikanwa\\(\\.[0-9]+\\)?-3"
255                   min-code      #xE00000
256                   max-code      ,(+ #xE00000 50100)
257                   code-offset   #xE00000))
258
259   (make-charset '=big5-pua
260                 "Big5-PUA"
261                 `(long-name     "Big5 with private used area"
262                   chars         256
263                   dimension     2
264                   columns       2
265                   graphic       2
266                   direction     l2r
267                   mother        chinese-big5
268                   registry      "Big5\\.ETEN"))
269   (define-charset-alias 'chinese-big5-pua '=big5-pua)
270   (make-charset '=big5-eten
271                 "Big5-ETEN"
272                 `(long-name     "Big5 ETEN"
273                   chars         256
274                   dimension     2
275                   columns       2
276                   graphic       2
277                   direction     l2r
278                   mother        chinese-big5
279                   min-code      #x8140
280                   max-code      #xFEFE
281                   registry      "Big5\\.ETEN"))
282   (define-charset-alias 'chinese-big5-eten '=big5-eten)
283   (make-charset 'chinese-big5-eten-a
284                 "Big5-ETEN-a"
285                 `(long-name     "Big5 ETEN (#xF9D6 .. #xF9FE)"
286                   chars         256
287                   dimension     2
288                   columns       2
289                   graphic       2
290                   direction     l2r
291                   mother        chinese-big5
292                   min-code      #xF9D6
293                   max-code      #xF9FE
294                   registry      "Big5\\.ETEN"))
295   (make-charset 'chinese-big5-eten-b
296                 "Big5-ETEN-b"
297                 `(long-name     "Big5 ETEN (#xC6A1 .. #xC8FE)"
298                   chars         256
299                   dimension     2
300                   columns       2
301                   graphic       2
302                   direction     l2r
303                   mother        chinese-big5
304                   min-code      #xC6A1
305                   max-code      #xC8FE
306                   registry      "Big5\\.ETEN"))
307   (make-charset '=big5-cdp
308                 "Big5-CDP"
309                 `(long-name     "Big5 with CDP extension"
310                   chars         256
311                   dimension     2
312                   columns       2
313                   graphic       2
314                   direction     l2r
315                   registry      "big5\\.cdp-0"
316                   mother        chinese-big5
317                   min-code      #x8140
318                   max-code      #x8DFE))
319   (define-charset-alias 'chinese-big5-cdp '=big5-cdp)
320   (let* ((i 1)
321          (hzk-min (+ (lsh #x6200 16) 65536))
322          (hzk-max (+ hzk-min 65535)))
323     (while (<= i 12)
324       (make-charset
325        (intern (format "=hanziku-%d" i))
326        (format "HANZIKU-%d" i)
327        `(long-name ,(format "HANZIKU (pseudo BIG5 encoding) part %d" i)
328                    chars 256
329                    dimension 2
330                    columns 2
331                    graphic 2
332                    direction l2r
333                    registry ,(format "hanziku-%d$" i i)
334                    min-code ,hzk-min
335                    max-code ,hzk-max
336                    code-offset ,hzk-min))
337       (define-charset-alias
338         (intern (format "ideograph-hanziku-%d" i))
339         (intern (format "=hanziku-%d" i)))
340       (setq hzk-min (1+ hzk-max)
341             hzk-max (+ hzk-min 65535))
342       (setq i (1+ i))))
343
344   (make-charset '=gt
345                 "GT"
346                 `(long-name     "GT 2000"
347                   chars         256
348                   dimension     3
349                   columns       2
350                   graphic       2
351                   direction     l2r
352                   registry      ""
353                   min-code      ,(lsh #x6100 16)
354                   max-code      ,(+ (lsh #x6100 16) 67547)
355                   code-offset   ,(lsh #x6100 16)))
356   (define-charset-alias 'ideograph-gt '=gt)
357   (make-charset '=gt-k
358                 "GT parts"
359                 `(long-name     "Ideographic parts of GT"
360                   chars         256
361                   dimension     2
362                   columns       2
363                   graphic       2
364                   direction     l2r
365                   registry      ""
366                   min-code      ,(lsh #x6110 16)
367                   max-code      ,(+ (lsh #x6110 16) 17090)
368                   code-offset   ,(lsh #x6110 16)))
369   (define-charset-alias 'ideograph-gt-k '=gt-k)
370   (let ((i 1))
371     (while (<= i 11)
372       (make-charset
373        (intern (format "=gt-pj-%d" i))
374        (format "GT PJ %d" i)
375        `(long-name ,(format "GT 2000 (pseudo JIS encoding) part %d" i)
376                    chars 94
377                    dimension 2
378                    columns 2
379                    graphic 0
380                    direction l2r
381                    registry ,(format "\\(GTpj-%d\\|jisx0208\\.GT-%d\\)$" i i)))
382       (define-charset-alias
383         (intern (format "ideograph-gt-pj-%d" i))
384         (intern (format "=gt-pj-%d" i)))
385       (setq i (1+ i))))
386   (make-charset
387    '=gt-pj-k1
388    "GT K1"
389    `(long-name "Ideographic parts of GT (pseudo JIS encoding) part 1"
390                chars 94
391                dimension 2
392                columns 2
393                graphic 0
394                direction l2r
395                registry "\\(GTKpj-1\\|jisx0208\\.GTK-1\\)$"))
396   (define-charset-alias 'ideograph-gt-pj-k1 '=gt-pj-k1)
397   (make-charset
398    '=gt-pj-k2
399    "GT K2"
400    `(long-name "Ideographic parts of GT (pseudo JIS encoding) part 2"
401                chars 94
402                dimension 2
403                columns 2
404                graphic 0
405                direction l2r
406                registry "\\(GTKpj-2\\|jisx0208\\.GTK-2\\)$"))
407   (define-charset-alias 'ideograph-gt-pj-k2 '=gt-pj-k2)
408   (make-charset '=cbeta "CBETA PUA"
409                 '(long-name     "CBETA private characters"
410                   chars         256
411                   dimension     2
412                   registry      "cbeta-0"
413                   graphic       2
414                   min-code      #xE20000
415                   max-code      #xE2FFFF
416                   code-offset   #xE20000
417                   columns       2
418                   direction     l2r))
419   (define-charset-alias 'ideograph-cbeta '=cbeta)
420   (make-charset '=jef-china3
421                 "JEF + CHINA3"
422                 `(long-name     "JEF + CHINA3 private characters"
423                   chars         256
424                   dimension     2
425                   columns       2
426                   graphic       2
427                   direction     l2r
428                   registry      "china3jef-0"
429                   min-code      #xE80000
430                   max-code      #xE8FFFF
431                   code-offset   #xE80000))
432   (define-charset-alias 'china3-jef '=jef-china3)
433   )
434
435 ;;; mule-conf.el ends here