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)
90 (define-coding-system-alias 'cp936 'chinese-iso-8bit)
92 (define-coding-system 'chinese-hz
93 "Hz/ZW 7-bit encoding for Chinese GB2312 (MIME:HZ-GB-2312)."
96 :charset-list '(ascii chinese-gb2312)
97 :mime-charset 'hz-gb-2312
98 :post-read-conversion 'post-read-decode-hz
99 :pre-write-conversion 'pre-write-encode-hz)
101 (define-coding-system-alias 'hz-gb-2312 'chinese-hz)
102 (define-coding-system-alias 'hz 'chinese-hz)
104 (set-language-info-alist
105 "Chinese-GB" '((charset chinese-gb2312 chinese-sisheng)
106 (coding-system chinese-iso-8bit iso-2022-cn chinese-hz)
107 (coding-priority chinese-iso-8bit chinese-big5 iso-2022-cn)
108 (input-method . "chinese-py-punct")
109 (features china-util)
110 (sample-text . "Chinese (
\e$AVPND
\e(B,
\e$AFUM(;0
\e(B,
\e$A::So
\e(B)
\e$ADc:C
\e(B")
111 (documentation . "Support for Chinese GB2312 character set.")
112 (tutorial . "TUTORIAL.cn"))
115 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
116 ;; Chinese BIG5 (traditional)
117 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
119 (define-coding-system 'chinese-big5
120 "BIG5 8-bit encoding for Chinese (MIME:Big5)"
121 :coding-type 'charset
123 :charset-list '(ascii big5)
126 (define-coding-system-alias 'big5 'chinese-big5)
127 (define-coding-system-alias 'cn-big5 'chinese-big5)
128 (define-coding-system-alias 'cp950 'chinese-big5)
130 (set-language-info-alist
131 "Chinese-BIG5" '((charset chinese-big5-1 chinese-big5-2)
132 (coding-system chinese-big5 chinese-iso-7bit)
133 (coding-priority chinese-big5 iso-2022-cn chinese-iso-8bit)
134 (input-method . "chinese-py-punct-b5")
135 (features china-util)
136 (sample-text . "Cantonese (
\e$(Gemk#
\e(B,
\e$(Gl]N)fc
\e(B)
\e$ATg3?
\e(B,
\e$ADc:C
\e(B")
137 (documentation . "Support for Chinese Big5 character set.")
138 (tutorial . "TUTORIAL.zh"))
141 (define-coding-system 'chinese-big5-hkscs
142 "BIG5-HKSCS 8-bit encoding for Chinese, Hong Kong supplement (MIME:Big5-HKSCS)"
143 :coding-type 'charset
145 :charset-list '(ascii big5-hkscs)
146 :mime-charset 'big5-hkscs)
147 (define-coding-system-alias 'big5-hkscs 'chinese-big5-hkscs)
148 (define-coding-system-alias 'cn-big5-hkscs 'chinese-big5-hkscs)
150 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
151 ;; Chinese CNS11643 (traditional)
152 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
154 (define-coding-system 'euc-tw
155 "ISO 2022 based EUC encoding for Chinese CNS11643."
156 :coding-type 'iso-2022
158 :charset-list '(ascii
166 :designation [ascii chinese-cns11643-1 (chinese-cns11643-1
172 chinese-cns11643-7) nil]
173 :mime-charset 'euc-tw)
175 (define-coding-system-alias 'euc-taiwan 'euc-tw)
177 (set-language-info-alist
178 "Chinese-CNS" '((charset chinese-cns11643-1 chinese-cns11643-2
179 chinese-cns11643-3 chinese-cns11643-4
180 chinese-cns11643-5 chinese-cns11643-6
182 (coding-system iso-2022-cn euc-tw)
183 (coding-priority iso-2022-cn euc-tw chinese-big5
185 (features china-util)
186 (input-method . "chinese-cns-quick")
187 ;; Fixme: presumably it won't accept big5 now.
189 Support for Chinese CNS character sets. Note that the EUC-TW coding system
190 accepts Big5 for input also (which is then converted to CNS)."))
193 (set-language-info-alist
194 "Chinese-EUC-TW" '((charset chinese-cns11643-1 chinese-cns11643-2
195 chinese-cns11643-3 chinese-cns11643-4
196 chinese-cns11643-5 chinese-cns11643-6
197 chinese-cns11643-7 chinese-big5-1 chinese-big5-2)
198 (coding-system euc-tw iso-2022-cn)
199 (coding-priority euc-tw chinese-big5 iso-2022-cn
201 (features china-util)
202 (input-method . "chinese-cns-quick")
204 Support for Chinese, prefering the EUC-TW character set. Note that
205 the EUC-TW coding system accepts Big5 for input also (which is then
206 converted to CNS)."))
212 (define-coding-system 'chinese-gbk
213 "GBK encoding for Chinese (MIME:GBK)."
214 :coding-type 'charset
216 :charset-list '(ascii chinese-gbk)
218 (define-coding-system-alias 'gbk 'chinese-gbk)
219 (define-coding-system-alias 'cp936 'chinese-gbk)
220 (define-coding-system-alias 'windows-936 'chinese-gbk)
222 (set-language-info-alist
223 "Chinese-GBK" '((charset chinese-gbk)
224 (coding-system chinese-gbk)
225 (coding-priority gbk iso-2022-cn chinese-big5
226 chinese-iso-8bit) ; fixme?
227 (input-method . "chinese-py-punct") ; fixme?
228 (features china-util)
229 (documentation . "Support for Chinese GBK character set."))
234 (define-coding-system 'chinese-gb18030
235 "GB18030 encoding for Chinese (MIME:GB18030)."
236 :coding-type 'charset
238 :charset-list '(ascii gb18030-2-byte
239 gb18030-4-byte-bmp gb18030-4-byte-smp
240 gb18030-4-byte-ext-1 gb18030-4-byte-ext-2)
241 :mime-charset 'gb18030)
243 (define-coding-system-alias 'gb18030 'chinese-gb18030)
245 (set-language-info-alist
246 "Chinese-GB18030" '((charset gb18030)
247 (coding-system chinese-gb18030)
248 (coding-priority gb18030 gbk iso-2022-cn chinese-big5
249 chinese-iso-8bit) ; fixme?
250 (input-method . "chinese-py-punct") ; fixme?
251 (features china-util)
253 . "Support for Chinese GB18030 character set."))
260 ;;; arch-tag: b82fcf7a-84f6-4e0b-b38c-1742dac0e09f
261 ;;; chinese.el ends here