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 ;; Keywords: multilingual, Chinese
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
27 ;; For Chinese, three character sets GB2312, BIG5, and CNS11643 are
32 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
34 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
36 (define-coding-system 'iso-2022-cn
37 "ISO 2022 based 7bit encoding for Chinese GB and CNS (MIME:ISO-2022-CN)."
38 :coding-type 'iso-2022
40 :charset-list '(ascii chinese-gb2312 chinese-cns11643-1 chinese-cns11643-2)
42 (nil chinese-gb2312 chinese-cns11643-1)
43 (nil chinese-cns11643-2)
45 :flags '(ascii-at-eol ascii-at-cntl 7-bit
46 designation locking-shift single-shift init-at-bol)
47 :mime-charset 'iso-2022-cn)
49 (define-coding-system-alias 'chinese-iso-7bit 'iso-2022-cn)
51 (define-coding-system 'iso-2022-cn-ext
52 "ISO 2022 based 7bit encoding for Chinese GB and CNS (MIME:ISO-2022-CN-EXT)."
53 :coding-type 'iso-2022
56 chinese-gb2312 chinese-cns11643-1
57 chinese-cns11643-2 chinese-cns11643-3 chinese-cns11643-4
58 chinese-cns11643-5 chinese-cns11643-6 chinese-cns11643-7)
60 (nil chinese-gb2312 chinese-cns11643-1)
61 (nil chinese-cns11643-2)
62 (nil chinese-cns11643-3 chinese-cns11643-4 chinese-cns11643-5
63 chinese-cns11643-6 chinese-cns11643-7)]
64 :flags '(ascii-at-eol ascii-at-cntl 7-bit
65 designation locking-shift single-shift init-at-bol)
66 :mime-charset 'iso-2022-cn-ext)
69 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
70 ;;; Chinese GB2312 (simplified)
71 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
73 (define-coding-system 'chinese-iso-8bit
74 "ISO 2022 based EUC encoding for Chinese GB2312 (MIME:CN-GB)."
75 :coding-type 'iso-2022
77 :charset-list '(ascii chinese-gb2312)
78 :designation [ascii chinese-gb2312 nil nil]
81 (define-coding-system-alias 'cn-gb-2312 'chinese-iso-8bit)
82 (define-coding-system-alias 'euc-china 'chinese-iso-8bit)
83 (define-coding-system-alias 'euc-cn 'chinese-iso-8bit)
84 (define-coding-system-alias 'cn-gb 'chinese-iso-8bit)
85 (define-coding-system-alias 'gb2312 'chinese-iso-8bit)
87 (define-coding-system 'chinese-hz
88 "Hz/ZW 7-bit encoding for Chinese GB2312 (MIME:HZ-GB-2312)."
91 :charset-list '(ascii chinese-gb2312)
92 :mime-charset 'hz-gb-2312
93 :post-read-conversion 'post-read-decode-hz
94 :pre-write-conversion 'pre-write-encode-hz)
96 (define-coding-system-alias 'hz-gb-2312 'chinese-hz)
97 (define-coding-system-alias 'hz 'chinese-hz)
99 (set-language-info-alist
100 "Chinese-GB" '((charset chinese-gb2312 chinese-sisheng)
101 (coding-system chinese-iso-8bit iso-2022-cn chinese-hz)
102 (coding-priority chinese-iso-8bit chinese-big5 iso-2022-cn)
103 (input-method . "chinese-py-punct")
104 (features china-util)
105 (sample-text . "Chinese (
\e$AVPND
\e(B,
\e$AFUM(;0
\e(B,
\e$A::So
\e(B)
\e$ADc:C
\e(B")
106 (documentation . "Support for Chinese GB2312 character set."))
109 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
110 ;; Chinese BIG5 (traditional)
111 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
113 (define-coding-system 'chinese-big5
114 "BIG5 8-bit encoding for Chinese (MIME:Big5)"
115 :coding-type 'charset
117 :charset-list '(ascii big5)
120 (define-coding-system-alias 'big5 'chinese-big5)
121 (define-coding-system-alias 'cn-big5 'chinese-big5)
123 (set-language-info-alist
124 "Chinese-BIG5" '((charset chinese-big5-1 chinese-big5-2)
125 (coding-system chinese-big5 chinese-iso-7bit)
126 (coding-priority chinese-big5 iso-2022-cn chinese-iso-8bit)
127 (input-method . "chinese-py-punct-b5")
128 (features china-util)
129 (sample-text . "Cantonese (
\e$(Gemk#
\e(B,
\e$(Gl]N)fc
\e(B)
\e$ATg3?
\e(B,
\e$ADc:C
\e(B")
130 (documentation . "Support for Chinese Big5 character set."))
133 (define-coding-system 'chinese-big5-hkscs
134 "BIG5-HKSCS 8-bit encoding for Chinese, Hong Kong supplement (MIME:Big5-HKSCS)"
135 :coding-type 'charset
137 :charset-list '(ascii big5-hkscs)
138 :mime-charset 'big5-hkscs)
139 (define-coding-system-alias 'big5-hkscs 'chinese-big5-hkscs)
140 (define-coding-system-alias 'cn-big5-hkscs 'chinese-big5-hkscs)
142 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
143 ;; Chinese CNS11643 (traditional)
144 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
146 (define-coding-system 'euc-tw
147 "ISO 2022 based EUC encoding for Chinese CNS11643."
148 :coding-type 'iso-2022
150 :charset-list '(ascii
158 :designation [ascii chinese-cns11643-1 (chinese-cns11643-1
164 chinese-cns11643-7) nil]
165 :mime-charset 'euc-tw)
167 (define-coding-system-alias 'euc-taiwan 'euc-tw)
169 (set-language-info-alist
170 "Chinese-CNS" '((charset chinese-cns11643-1 chinese-cns11643-2
171 chinese-cns11643-3 chinese-cns11643-4
172 chinese-cns11643-5 chinese-cns11643-6
174 (coding-system iso-2022-cn euc-tw)
175 (coding-priority iso-2022-cn euc-tw chinese-big5
177 (features china-util)
178 (input-method . "chinese-cns-quick")
179 ;; Fixme: presumably it won't accept big5 now.
181 Support for Chinese CNS character sets. Note that EUC-TW coding system
182 accepts Big5 for input also (which is then converted to CNS)."))
187 (define-coding-system 'chinese-gbk
188 "GBK encoding for Chinese (MIME:GBK)."
189 :coding-type 'charset
191 :charset-list '(chinese-gbk)
193 (define-coding-system-alias 'gbk 'chinese-gbk)
194 (define-coding-system-alias 'cp936 'chinese-gbk)
195 (define-coding-system-alias 'windows-936 'chinese-gbk)
197 (set-language-info-alist
198 "Chinese-GBK" '((charset chinese-gbk)
199 (coding-system chinese-gbk)
200 (coding-priority gbk iso-2022-cn chinese-big5
201 chinese-iso-8bit) ; fixme?
202 (input-method . "chinese-py-punct") ; fixme?
203 (features china-util)
204 (documentation . "Support for Chinese GBK character set."))
209 (define-coding-system 'chinese-gb18030
210 "GB18030 encoding for Chinese (MIME:GB18030)."
211 :coding-type 'charset
213 :charset-list '(gb18030)
214 :mime-charset 'gb18030
216 (define-coding-system-alias 'gb18030 'chinese-gb18030)
218 (set-language-info-alist
219 "Chinese-GB18030" '((charset gb18030)
220 (coding-system chinese-gb18030)
221 (coding-priority gb18030 gbk iso-2022-cn chinese-big5
222 chinese-iso-8bit) ; fixme?
223 (input-method . "chinese-py-punct") ; fixme?
224 (features china-util)
226 . "Support for Chinese GB18030 character set."))
233 ;;; chinese.el ends here