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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
134 ;; Chinese CNS11643 (traditional)
135 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
137 (define-coding-system 'euc-tw
138 "ISO 2022 based EUC encoding for Chinese CNS11643."
139 :coding-type
'iso-2022
141 :charset-list
'(ascii
149 :designation
[ascii chinese-cns11643-1
(chinese-cns11643-1
155 chinese-cns11643-7
) nil
]
156 :mime-charset
'euc-tw
)
158 (define-coding-system-alias 'euc-taiwan
'euc-tw
)
160 (set-language-info-alist
161 "Chinese-CNS" '((charset chinese-cns11643-1 chinese-cns11643-2
162 chinese-cns11643-3 chinese-cns11643-4
163 chinese-cns11643-5 chinese-cns11643-6
165 (coding-system iso-2022-cn euc-tw
)
166 (coding-priority iso-2022-cn euc-tw chinese-big5
168 (features china-util
)
169 (input-method .
"chinese-cns-quick")
170 ;; Fixme: presumably it won't accept big5 now.
172 Support for Chinese CNS character sets. Note that EUC-TW coding system
173 accepts Big5 for input also (which is then converted to CNS)."))
178 (define-coding-system 'chinese-gbk
179 "GBK encoding for Chinese (MIME:GBK)."
180 :coding-type
'charset
182 :charset-list
'(chinese-gbk)
184 (define-coding-system-alias 'gbk
'chinese-gbk
)
185 (define-coding-system-alias 'cp936
'chinese-gbk
)
186 (define-coding-system-alias 'windows-936
'chinese-gbk
)
188 (set-language-info-alist
189 "Chinese-GBK" '((charset chinese-gbk
)
190 (coding-system chinese-gbk
)
191 (coding-priority gbk iso-2022-cn chinese-big5
192 chinese-iso-8bit
) ; fixme?
193 (input-method .
"chinese-py-punct") ; fixme?
194 (features china-util
)
195 (documentation .
"Support for Chinese GBK character set."))
198 ;; Fixme: add HKSCS, GB18030
202 ;;; chinese.el ends here