1 ;;; chinese.el --- support for Chinese -*- coding: iso-2022-7bit; -*-
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
4 ;; Licensed to the Free Software Foundation.
6 ;; National Institute of Advanced Industrial Science and Technology (AIST)
7 ;; Registration Number H13PRO009
9 ;; Keywords: multilingual, Chinese
11 ;; This file is part of GNU Emacs.
13 ;; GNU Emacs is free software; you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by
15 ;; the Free Software Foundation; either version 2, or (at your option)
18 ;; GNU Emacs is distributed in the hope that it will be useful,
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;; GNU General Public License for more details.
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26 ;; Boston, MA 02111-1307, USA.
30 ;; For Chinese, three character sets GB2312, BIG5, and CNS11643 are
35 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
37 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
40 (define-coding-system 'iso-2022-cn
41 "ISO 2022 based 7bit encoding for Chinese GB and CNS (MIME:ISO-2022-CN)."
42 :coding-type
'iso-2022
44 :charset-list
'(ascii chinese-gb2312 chinese-cns11643-1 chinese-cns11643-2
)
46 (nil chinese-gb2312 chinese-cns11643-1
)
47 (nil chinese-cns11643-2
)
49 :flags
'(ascii-at-eol ascii-at-cntl
7-bit
50 designation locking-shift single-shift init-at-bol
)
51 :mime-charset
'iso-2022-cn
)
53 (define-coding-system-alias 'chinese-iso-7bit
'iso-2022-cn
)
55 (define-coding-system 'iso-2022-cn-ext
56 "ISO 2022 based 7bit encoding for Chinese GB and CNS (MIME:ISO-2022-CN-EXT)."
57 :coding-type
'iso-2022
60 chinese-gb2312 chinese-cns11643-1
61 chinese-cns11643-2 chinese-cns11643-3 chinese-cns11643-4
62 chinese-cns11643-5 chinese-cns11643-6 chinese-cns11643-7
)
64 (nil chinese-gb2312 chinese-cns11643-1
)
65 (nil chinese-cns11643-2
)
66 (nil chinese-cns11643-3 chinese-cns11643-4 chinese-cns11643-5
67 chinese-cns11643-6 chinese-cns11643-7
)]
68 :flags
'(ascii-at-eol ascii-at-cntl
7-bit
69 designation locking-shift single-shift init-at-bol
)
70 :mime-charset
'iso-2022-cn-ext
)
73 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
74 ;;; Chinese GB2312 (simplified)
75 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
77 (define-coding-system 'chinese-iso-8bit
78 "ISO 2022 based EUC encoding for Chinese GB2312 (MIME:CN-GB)."
79 :coding-type
'iso-2022
81 :charset-list
'(ascii chinese-gb2312
)
82 :designation
[ascii chinese-gb2312 nil nil
]
85 (define-coding-system-alias 'cn-gb-2312
'chinese-iso-8bit
)
86 (define-coding-system-alias 'euc-china
'chinese-iso-8bit
)
87 (define-coding-system-alias 'euc-cn
'chinese-iso-8bit
)
88 (define-coding-system-alias 'cn-gb
'chinese-iso-8bit
)
89 (define-coding-system-alias 'gb2312
'chinese-iso-8bit
)
91 (define-coding-system 'chinese-hz
92 "Hz/ZW 7-bit encoding for Chinese GB2312 (MIME:HZ-GB-2312)."
95 :charset-list
'(ascii chinese-gb2312
)
96 :mime-charset
'hz-gb-2312
97 :post-read-conversion
'post-read-decode-hz
98 :pre-write-conversion
'pre-write-encode-hz
)
100 (define-coding-system-alias 'hz-gb-2312
'chinese-hz
)
101 (define-coding-system-alias 'hz
'chinese-hz
)
103 (set-language-info-alist
104 "Chinese-GB" '((charset chinese-gb2312 chinese-sisheng
)
105 (coding-system chinese-iso-8bit iso-2022-cn chinese-hz
)
106 (coding-priority chinese-iso-8bit chinese-big5 iso-2022-cn
)
107 (input-method .
"chinese-py-punct")
108 (features china-util
)
109 (sample-text .
"Chinese (\e$AVPND\e(B,\e$AFUM(;0\e(B,\e$A::So\e(B) \e$ADc:C\e(B")
110 (documentation .
"Support for Chinese GB2312 character set.")
111 (tutorial .
"TUTORIAL.cn"))
114 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
115 ;; Chinese BIG5 (traditional)
116 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
118 (define-coding-system 'chinese-big5
119 "BIG5 8-bit encoding for Chinese (MIME:Big5)"
120 :coding-type
'charset
122 :charset-list
'(ascii big5
)
125 (define-coding-system-alias 'big5
'chinese-big5
)
126 (define-coding-system-alias 'cn-big5
'chinese-big5
)
128 (set-language-info-alist
129 "Chinese-BIG5" '((charset chinese-big5-1 chinese-big5-2
)
130 (coding-system chinese-big5 chinese-iso-7bit
)
131 (coding-priority chinese-big5 iso-2022-cn chinese-iso-8bit
)
132 (input-method .
"chinese-py-punct-b5")
133 (features china-util
)
134 (sample-text .
"Cantonese (\e$(0GnM$\e(B,\e$(0N]0*Hd\e(B) \e$(0*/=(\e(B, \e$(0+$)p\e(B")
135 (documentation .
"Support for Chinese Big5 character set.")
136 (tutorial .
"TUTORIAL.zh"))
139 (define-coding-system 'chinese-big5-hkscs
140 "BIG5-HKSCS 8-bit encoding for Chinese, Hong Kong supplement (MIME:Big5-HKSCS)"
141 :coding-type
'charset
143 :charset-list
'(ascii big5-hkscs
)
144 :mime-charset
'big5-hkscs
)
145 (define-coding-system-alias 'big5-hkscs
'chinese-big5-hkscs
)
146 (define-coding-system-alias 'cn-big5-hkscs
'chinese-big5-hkscs
)
148 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
149 ;; Chinese CNS11643 (traditional)
150 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
152 (define-coding-system 'euc-tw
153 "ISO 2022 based EUC encoding for Chinese CNS11643."
154 :coding-type
'iso-2022
156 :charset-list
'(ascii
164 :designation
[ascii chinese-cns11643-1
(chinese-cns11643-1
170 chinese-cns11643-7
) nil
]
171 :mime-charset
'euc-tw
)
173 (define-coding-system-alias 'euc-taiwan
'euc-tw
)
175 (set-language-info-alist
176 "Chinese-CNS" '((charset chinese-cns11643-1 chinese-cns11643-2
177 chinese-cns11643-3 chinese-cns11643-4
178 chinese-cns11643-5 chinese-cns11643-6
180 (coding-system iso-2022-cn euc-tw
)
181 (coding-priority iso-2022-cn euc-tw chinese-big5
183 (features china-util
)
184 (input-method .
"chinese-cns-quick")
185 ;; Fixme: presumably it won't accept big5 now.
187 Support for Chinese CNS character sets. Note that the EUC-TW coding system
188 accepts Big5 for input also (which is then converted to CNS)."))
191 (set-language-info-alist
192 "Chinese-EUC-TW" '((charset chinese-cns11643-1 chinese-cns11643-2
193 chinese-cns11643-3 chinese-cns11643-4
194 chinese-cns11643-5 chinese-cns11643-6
195 chinese-cns11643-7 chinese-big5-1 chinese-big5-2
)
196 (coding-system euc-tw iso-2022-cn
)
197 (coding-priority euc-tw chinese-big5 iso-2022-cn
199 (features china-util
)
200 (input-method .
"chinese-cns-quick")
202 Support for Chinese, prefering the EUC-TW character set. Note that
203 the EUC-TW coding system accepts Big5 for input also (which is then
204 converted to CNS)."))
210 (define-coding-system 'chinese-gbk
211 "GBK encoding for Chinese (MIME:GBK)."
212 :coding-type
'charset
214 :charset-list
'(chinese-gbk)
216 (define-coding-system-alias 'gbk
'chinese-gbk
)
217 (define-coding-system-alias 'cp936
'chinese-gbk
)
218 (define-coding-system-alias 'windows-936
'chinese-gbk
)
220 (set-language-info-alist
221 "Chinese-GBK" '((charset chinese-gbk
)
222 (coding-system chinese-gbk
)
223 (coding-priority gbk iso-2022-cn chinese-big5
224 chinese-iso-8bit
) ; fixme?
225 (input-method .
"chinese-py-punct") ; fixme?
226 (features china-util
)
227 (documentation .
"Support for Chinese GBK character set."))
232 (define-coding-system 'chinese-gb18030
233 "GB18030 encoding for Chinese (MIME:GB18030)."
234 :coding-type
'charset
236 :charset-list
'(ascii gb18030-2-byte
237 gb18030-4-byte-bmp gb18030-4-byte-smp
238 gb18030-4-byte-ext-1 gb18030-4-byte-ext-2
)
239 :mime-charset
'gb18030
)
241 (define-coding-system-alias 'gb18030
'chinese-gb18030
)
243 (set-language-info-alist
244 "Chinese-GB18030" '((charset gb18030
)
245 (coding-system chinese-gb18030
)
246 (coding-priority gb18030 gbk iso-2022-cn chinese-big5
247 chinese-iso-8bit
) ; fixme?
248 (input-method .
"chinese-py-punct") ; fixme?
249 (features china-util
)
251 .
"Support for Chinese GB18030 character set."))
258 ;;; arch-tag: b82fcf7a-84f6-4e0b-b38c-1742dac0e09f
259 ;;; chinese.el ends here