1 ;;; chinese.el --- support for Chinese -*- coding: iso-2022-7bit; -*-
3 ;; Copyright (C) 2001, 2003 Free Software Foundation, Inc.
4 ;; Copyright (C) 1995, 1997, 1998
5 ;; National Institute of Advanced Industrial Science and Technology (AIST)
6 ;; Registration Number H14PRO021
8 ;; National Institute of Advanced Industrial Science and Technology (AIST)
9 ;; Registration Number H13PRO009
11 ;; Keywords: multilingual, Chinese
13 ;; This file is part of GNU Emacs.
15 ;; GNU Emacs is free software; you can redistribute it and/or modify
16 ;; it under the terms of the GNU General Public License as published by
17 ;; the Free Software Foundation; either version 2, or (at your option)
20 ;; GNU Emacs is distributed in the hope that it will be useful,
21 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;; GNU General Public License for more details.
25 ;; You should have received a copy of the GNU General Public License
26 ;; along with GNU Emacs; see the file COPYING. If not, write to the
27 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
28 ;; Boston, MA 02111-1307, USA.
32 ;; For Chinese, three character sets GB2312, BIG5, and CNS11643 are
37 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
39 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
42 (define-coding-system 'iso-2022-cn
43 "ISO 2022 based 7bit encoding for Chinese GB and CNS (MIME:ISO-2022-CN)."
44 :coding-type
'iso-2022
46 :charset-list
'(ascii chinese-gb2312 chinese-cns11643-1 chinese-cns11643-2
)
48 (nil chinese-gb2312 chinese-cns11643-1
)
49 (nil chinese-cns11643-2
)
51 :flags
'(ascii-at-eol ascii-at-cntl
7-bit
52 designation locking-shift single-shift init-at-bol
)
53 :mime-charset
'iso-2022-cn
)
55 (define-coding-system-alias 'chinese-iso-7bit
'iso-2022-cn
)
57 (define-coding-system 'iso-2022-cn-ext
58 "ISO 2022 based 7bit encoding for Chinese GB and CNS (MIME:ISO-2022-CN-EXT)."
59 :coding-type
'iso-2022
62 chinese-gb2312 chinese-cns11643-1
63 chinese-cns11643-2 chinese-cns11643-3 chinese-cns11643-4
64 chinese-cns11643-5 chinese-cns11643-6 chinese-cns11643-7
)
66 (nil chinese-gb2312 chinese-cns11643-1
)
67 (nil chinese-cns11643-2
)
68 (nil chinese-cns11643-3 chinese-cns11643-4 chinese-cns11643-5
69 chinese-cns11643-6 chinese-cns11643-7
)]
70 :flags
'(ascii-at-eol ascii-at-cntl
7-bit
71 designation locking-shift single-shift init-at-bol
)
72 :mime-charset
'iso-2022-cn-ext
)
75 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
76 ;;; Chinese GB2312 (simplified)
77 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
79 (define-coding-system 'chinese-iso-8bit
80 "ISO 2022 based EUC encoding for Chinese GB2312 (MIME:GB2312)."
81 :coding-type
'iso-2022
83 :charset-list
'(ascii chinese-gb2312
)
84 :designation
[ascii chinese-gb2312 nil nil
]
85 :mime-charset
'gb2312
)
87 (define-coding-system-alias 'cn-gb-2312
'chinese-iso-8bit
)
88 (define-coding-system-alias 'euc-china
'chinese-iso-8bit
)
89 (define-coding-system-alias 'euc-cn
'chinese-iso-8bit
)
90 (define-coding-system-alias 'cn-gb
'chinese-iso-8bit
)
91 (define-coding-system-alias 'gb2312
'chinese-iso-8bit
)
92 (define-coding-system-alias 'cp936
'chinese-iso-8bit
)
94 (define-coding-system 'chinese-hz
95 "Hz/ZW 7-bit encoding for Chinese GB2312 (MIME:HZ-GB-2312)."
98 :charset-list
'(ascii chinese-gb2312
)
99 :mime-charset
'hz-gb-2312
100 :post-read-conversion
'post-read-decode-hz
101 :pre-write-conversion
'pre-write-encode-hz
)
103 (define-coding-system-alias 'hz-gb-2312
'chinese-hz
)
104 (define-coding-system-alias 'hz
'chinese-hz
)
106 (set-language-info-alist
107 "Chinese-GB" '((charset chinese-gb2312 chinese-sisheng
)
108 (coding-system chinese-iso-8bit iso-2022-cn chinese-hz
)
109 (coding-priority chinese-iso-8bit chinese-big5 iso-2022-cn
)
110 (input-method .
"chinese-py-punct")
111 (features china-util
)
112 (sample-text .
"Chinese (\e$AVPND\e(B,\e$AFUM(;0\e(B,\e$A::So\e(B) \e$ADc:C\e(B")
113 (documentation .
"Support for Chinese GB2312 character set.")
114 (tutorial .
"TUTORIAL.cn"))
117 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
118 ;; Chinese BIG5 (traditional)
119 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
121 (define-coding-system 'chinese-big5
122 "BIG5 8-bit encoding for Chinese (MIME:Big5)"
123 :coding-type
'charset
125 :charset-list
'(ascii big5
)
128 (define-coding-system-alias 'big5
'chinese-big5
)
129 (define-coding-system-alias 'cn-big5
'chinese-big5
)
130 (define-coding-system-alias 'cp950
'chinese-big5
)
132 (set-language-info-alist
133 "Chinese-BIG5" '((charset chinese-big5-1 chinese-big5-2
)
134 (coding-system chinese-big5 chinese-iso-7bit
)
135 (coding-priority chinese-big5 iso-2022-cn chinese-iso-8bit
)
136 (input-method .
"chinese-py-punct-b5")
137 (features china-util
)
138 (sample-text .
"Cantonese (\e$(Gemk#\e(B,\e$(Gl]N)fc\e(B) \e$ATg3?\e(B, \e$ADc:C\e(B")
139 (documentation .
"Support for Chinese Big5 character set.")
140 (tutorial .
"TUTORIAL.zh"))
143 (define-coding-system 'chinese-big5-hkscs
144 "BIG5-HKSCS 8-bit encoding for Chinese, Hong Kong supplement (MIME:Big5-HKSCS)"
145 :coding-type
'charset
147 :charset-list
'(ascii big5-hkscs
)
148 :mime-charset
'big5-hkscs
)
149 (define-coding-system-alias 'big5-hkscs
'chinese-big5-hkscs
)
150 (define-coding-system-alias 'cn-big5-hkscs
'chinese-big5-hkscs
)
152 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
153 ;; Chinese CNS11643 (traditional)
154 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
156 (define-coding-system 'euc-tw
157 "ISO 2022 based EUC encoding for Chinese CNS11643."
158 :coding-type
'iso-2022
160 :charset-list
'(ascii
168 :designation
[ascii chinese-cns11643-1
(chinese-cns11643-1
174 chinese-cns11643-7
) nil
]
175 :mime-charset
'euc-tw
)
177 (define-coding-system-alias 'euc-taiwan
'euc-tw
)
179 (set-language-info-alist
180 "Chinese-CNS" '((charset chinese-cns11643-1 chinese-cns11643-2
181 chinese-cns11643-3 chinese-cns11643-4
182 chinese-cns11643-5 chinese-cns11643-6
184 (coding-system iso-2022-cn euc-tw
)
185 (coding-priority iso-2022-cn euc-tw chinese-big5
187 (features china-util
)
188 (input-method .
"chinese-cns-quick")
189 ;; Fixme: presumably it won't accept big5 now.
191 Support for Chinese CNS character sets. Note that the EUC-TW coding system
192 accepts Big5 for input also (which is then converted to CNS)."))
195 (set-language-info-alist
196 "Chinese-EUC-TW" '((charset chinese-cns11643-1 chinese-cns11643-2
197 chinese-cns11643-3 chinese-cns11643-4
198 chinese-cns11643-5 chinese-cns11643-6
199 chinese-cns11643-7 chinese-big5-1 chinese-big5-2
)
200 (coding-system euc-tw iso-2022-cn
)
201 (coding-priority euc-tw chinese-big5 iso-2022-cn
203 (features china-util
)
204 (input-method .
"chinese-cns-quick")
206 Support for Chinese, prefering the EUC-TW character set. Note that
207 the EUC-TW coding system accepts Big5 for input also (which is then
208 converted to CNS)."))
214 (define-coding-system 'chinese-gbk
215 "GBK encoding for Chinese (MIME:GBK)."
216 :coding-type
'charset
218 :charset-list
'(ascii chinese-gbk
)
220 (define-coding-system-alias 'gbk
'chinese-gbk
)
221 (define-coding-system-alias 'cp936
'chinese-gbk
)
222 (define-coding-system-alias 'windows-936
'chinese-gbk
)
224 (set-language-info-alist
225 "Chinese-GBK" '((charset chinese-gbk
)
226 (coding-system chinese-gbk
)
227 (coding-priority gbk iso-2022-cn chinese-big5
228 chinese-iso-8bit
) ; fixme?
229 (input-method .
"chinese-py-punct") ; fixme?
230 (features china-util
)
231 (documentation .
"Support for Chinese GBK character set."))
236 (define-coding-system 'chinese-gb18030
237 "GB18030 encoding for Chinese (MIME:GB18030)."
238 :coding-type
'charset
240 :charset-list
'(ascii gb18030-2-byte
241 gb18030-4-byte-bmp gb18030-4-byte-smp
242 gb18030-4-byte-ext-1 gb18030-4-byte-ext-2
)
243 :mime-charset
'gb18030
)
245 (define-coding-system-alias 'gb18030
'chinese-gb18030
)
247 (set-language-info-alist
248 "Chinese-GB18030" '((charset gb18030
)
249 (coding-system chinese-gb18030
)
250 (coding-priority gb18030 gbk iso-2022-cn chinese-big5
251 chinese-iso-8bit
) ; fixme?
252 (input-method .
"chinese-py-punct") ; fixme?
253 (features china-util
)
255 .
"Support for Chinese GB18030 character set."))
262 ;;; arch-tag: b82fcf7a-84f6-4e0b-b38c-1742dac0e09f
263 ;;; chinese.el ends here