]> code.delx.au - gnu-emacs/blob - lisp/language/vietnamese.el
New directory
[gnu-emacs] / lisp / language / vietnamese.el
1 ;;; vietnamese.el --- support for Vietnamese -*- coding: iso-2022-7bit; -*-
2
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
4 ;; Licensed to the Free Software Foundation.
5
6 ;; Keywords: multilingual, Vietnamese
7
8 ;; This file is part of GNU Emacs.
9
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)
13 ;; any later version.
14
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.
19
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.
24
25 ;;; Commentary:
26
27 ;; For Vietnames, the character sets VISCII, VSCII and TCVN-5712 are
28 ;; supported.
29
30 ;;; Code:
31
32 (defvar viet-viscii-decode-table
33 [;; VISCII is a full 8-bit code.
34 0 1 ?\e,2F\e(B 3 4 ?\e,2G\e(B ?\e,2g\e(B 7 8 9 10 11 12 13 14 15
35 16 17 18 19 ?\e,2V\e(B 21 22 23 24 ?\e,2[\e(B 26 27 28 29 ?\e,2\\e(B 31
36 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
37 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
38 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
39 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
40 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
41 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
42 ?\e,2U\e(B ?\e,2!\e(B ?\e,2"\e(B ?\e,2#\e(B ?\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(B ?\e,1a\e(B ?\e,1b\e(B ?\e,1c\e(B ?\e,1d\e(B ?\e,1e\e(B ?\e,1f\e(B ?\e,1g\e(B ?\e,1h\e(B ?\e,1i\e(B ?\e,1j\e(B ?\e,1k\e(B ?\e,1l\e(B ?\e,1m\e(B ?\e,1n\e(B ?\e,1o\e(B
49 ?\e,1p\e(B ?\e,1q\e(B ?\e,1r\e(B ?\e,1s\e(B ?\e,1t\e(B ?\e,1u\e(B ?\e,1v\e(B ?\e,1w\e(B ?\e,1x\e(B ?\e,1y\e(B ?\e,1z\e(B ?\e,1{\e(B ?\e,1|\e(B ?\e,1}\e(B ?\e,1~\e(B ?\e,2f\e(B ]
50 "Vietnamese VISCII decoding table.")
51
52 (let ((table (make-translation-table-from-vector viet-viscii-decode-table)))
53 (define-translation-table 'viet-viscii-nonascii-translation-table table)
54 (define-translation-table 'viet-viscii-encode-table
55 (char-table-extra-slot table 0)))
56
57 ;;;
58 ;;; VSCII is a pre-version of TCVN-5712 and deprecated
59 ;;;
60 (defvar viet-vscii-decode-table
61 [;; VSCII is a full 8-bit code.
62 0 ?\e,2z\e(B ?\e,2x\e(B 3 ?\e,2W\e(B ?\e,2X\e(B ?\e,2f\e(B 7 8 9 10 11 12 13 14 15
63 16 ?\e,2Q\e(B ?\e,2_\e(B ?\e,2O\e(B ?\e,2V\e(B ?\e,2[\e(B ?\e,2}\e(B ?\e,2\\e(B 24 25 26 27 28 29 30 31
64 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
65 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
66 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
67 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
68 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
69 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
70 ?\e,2`\e(B ?\e,2d\e(B ?\e,2c\e(B ?\e,2a\e(B ?\e,2U\e(B ?\e,2#\e(B ?\e,2'\e(B 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,1/\e(B ?\e,15\e(B ?\e,16\e(B ?\e,17\e(B ?\e,1^\e(B ?\e,1>\e(B ?\e,1~\e(B ?\e,1y\e(B
77 ?\e,22\e(B ?\e,1|\e(B ?\e,1{\e(B ?\e,1z\e(B ?\e,1x\e(B ?\e,1W\e(B ?\e,1X\e(B ?\e,1f\e(B ?\e,1Q\e(B ?\e,1q\e(B ?\e,1O\e(B ?\e,1V\e(B ?\e,1[\e(B ?\e,1}\e(B ?\e,1\\e(B ?\e,2/\e(B]
78 "Vietnamese VSCII decoding table.")
79
80 (let ((table (make-translation-table-from-vector viet-vscii-decode-table)))
81 (define-translation-table 'viet-vscii-nonascii-translation-table table)
82 (define-translation-table 'viet-vscii-encode-table
83 (char-table-extra-slot table 0)))
84
85 ;; Does not support combining characters in the range [176, 180]
86 (defvar viet-tcvn-decode-table
87 [;; TCVN is a full 8-bit code.
88 0 ?\e,2z\e(B ?\e,2x\e(B 3 ?\e,2W\e(B ?\e,2X\e(B ?\e,2f\e(B 7 8 9 10 11 12 13 14 15
89 16 ?\e,2Q\e(B ?\e,2q\e(B ?\e,2O\e(B ?\e,2V\e(B ?\e,2[\e(B ?\e,2}\e(B ?\e,2\\e(B 24 25 26 27 28 29 30 31
90 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
91 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
92 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
93 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
95 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
96 ?\e,2`\e(B ?\e,2d\e(B ?\e,2c\e(B ?\e,2a\e(B ?\e,2U\e(B ?\e,2#\e(B ?\e,2'\e(B ?\e,2h\e(B ?\e,2k\e(B ?\e,2(\e(B ?\e,2i\e(B ?\e,2)\e(B ?\e,2.\e(B ?\e,2l\e(B ?\e,2o\e(B ?\e,2n\e(B
97 ?\e,2m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e,1{\e(B ?\e,1z\e(B ?\e,1x\e(B ?\e,1W\e(B ?\e,1X\e(B ?\e,1f\e(B ?\e,1Q\e(B ?\e,1q\e(B ?\e,1O\e(B ?\e,1V\e(B ?\e,1[\e(B ?\e,1}\e(B ?\e,1\\e(B ?\e,2/\e(B]
104 "Vietnamese TCVN-5712 decoding table.")
105
106 (let ((table (make-translation-table-from-vector viet-tcvn-decode-table)))
107 (define-translation-table 'viet-tcvn-nonascii-translation-table table)
108 (define-translation-table 'viet-tcvn-encode-table
109 (char-table-extra-slot table 0)))
110
111 ;; (defvar viet-vps-decode-table
112 ;; [;; VPS is a full 8-bit code.
113 ;; 0 1 ?\e,2U\e(B ?\e,2'\e(B ?\e,2#\e(B ?\e,2)\e(B ?\e,2.\e(B 7 8 9 10 11 12 13 14 15
114 ;; ?\e,28\e(B ?\e,2w\e(B ?\e,25\e(B ?\e,2~\e(B ?\e,2x\e(B ?\e,2q\e(B 22 23 24 ?\e,2\\e(B 26 27 ?\e,2g\e(B ?\e,2f\e(B 30 31
115 ;; 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
116 ;; 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
117 ;; 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
118 ;; 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
119 ;; 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
120 ;; 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
121 ;; ?\e,2`\e(B ?\e,2d\e(B ?\e,2c\e(B ?\e,2$\e(B ?\e,2%\e(B ?\e,2&\e(B ?\e,1w\e(B ?\e,12\e(B ?\e,2e\e(B ?\e,1*\e(B ?\e,1+\e(B ?\e,1,\e(B ?\e,1.\e(B ?\e,2!\e(B ?\e,2"\e(B ?\e,2F\e(B
122 ;; ?\e,2*\e(B 145 146 ?\e,2+\e(B ?\e,2,\e(B ?\e,2-\e(B ?\e,2/\e(B ?\e,20\e(B ?\e,21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246 ?\e,2=\e(B ?\e,1x\e(B ?\e,1y\e(B ?\e,1z\e(B ?\e,1|\e(B 252 ?\e,2V\e(B ?\e,2(\e(B ?\e,1O\e(B]
129 ;; "Vietnamese VPS decoding table.")
130 ;;
131 ;; (let ((table (make-translation-table-from-vector viet-vps-decode-table)))
132 ;; (define-translation-table 'viet-vps-nonascii-translation-table table)
133 ;; (define-translation-table 'viet-vps-encode-table
134 ;; (char-table-extra-slot table 0)))
135
136 (define-ccl-program ccl-decode-viscii
137 `(3
138 ((loop
139 (r0 = 0)
140 (read r1)
141 (translate-character viet-viscii-nonascii-translation-table r0 r1)
142 (write-multibyte-character r0 r1)
143 (repeat))))
144 "CCL program to decode VISCII 1.1")
145
146 (define-ccl-program ccl-encode-viscii
147 `(1
148 ((loop
149 (read-multibyte-character r0 r1)
150 (translate-character viet-viscii-encode-table r0 r1)
151 (write-repeat r1))))
152 "CCL program to encode VISCII 1.1")
153
154 (define-ccl-program ccl-encode-viscii-font
155 `(0
156 ;; In: R0:vietnamese-viscii-lower/vietnamese-viscii-upper
157 ;; R1:position code
158 ;; Out: R1:font code point
159 (translate-character viet-viscii-encode-table r0 r1))
160 "CCL program to encode Vietnamese chars to VISCII 1.1 font")
161
162 (define-ccl-program ccl-decode-vscii
163 `(3
164 ((loop
165 (r0 = 0)
166 (read r1)
167 (translate-character viet-vscii-nonascii-translation-table r0 r1)
168 (write-multibyte-character r0 r1)
169 (repeat))))
170 "CCL program to decode VSCII-1.")
171
172 (define-ccl-program ccl-encode-vscii
173 `(1
174 ((loop
175 (read-multibyte-character r0 r1)
176 (translate-character viet-vscii-encode-table r0 r1)
177 (write-repeat r1))))
178 "CCL program to encode VSCII-1.")
179
180 (define-ccl-program ccl-encode-vscii-font
181 `(0
182 ;; In: R0:vietnamese-viscii-lower/vietnamese-viscii-upper
183 ;; R1:position code
184 ;; Out: R1:font code point
185 (translate-character viet-vscii-encode-table r0 r1))
186 "CCL program to encode Vietnamese chars to VSCII-1 font.")
187
188 (define-ccl-program ccl-decode-tcvn
189 `(3
190 ((loop
191 (r0 = 0)
192 (read r1)
193 (translate-character viet-tcvn-nonascii-translation-table r0 r1)
194 (write-multibyte-character r0 r1)
195 (repeat))))
196 "CCL program to decode TCVN-5712.")
197
198 (define-ccl-program ccl-encode-tcvn
199 `(1
200 ((loop
201 (read-multibyte-character r0 r1)
202 (translate-character viet-tcvn-encode-table r0 r1)
203 (write-repeat r1))))
204 "CCL program to encode TCVN-5712.")
205
206 (define-ccl-program ccl-encode-tcvn-font
207 `(0
208 ;; In: R0:vietnamese-viscii-lower/vietnamese-viscii-upper
209 ;; R1:position code
210 ;; Out: R1:font code point
211 (translate-character viet-tcvn-encode-table r0 r1))
212 "CCL program to encode Vietnamese chars to TCVN-5712 font.")
213
214 ;; (define-ccl-program ccl-decode-vps
215 ;; `(3
216 ;; ((loop
217 ;; (r0 = 0)
218 ;; (read r1)
219 ;; (translate-character viet-vps-nonascii-translation-table r0 r1)
220 ;; (write-multibyte-character r0 r1)
221 ;; (repeat))))
222 ;; "CCL program to decode VPS.")
223 ;;
224 ;; (define-ccl-program ccl-encode-vps
225 ;; `(1
226 ;; ((loop
227 ;; (read-multibyte-character r0 r1)
228 ;; (translate-character viet-vps-encode-table r0 r1)
229 ;; (write-repeat r1))))
230 ;; "CCL program to encode VPS.")
231 ;;
232 ;; (define-ccl-program ccl-encode-vps-font
233 ;; `(0
234 ;; ;; In: R0:vietnamese-viscii-lower/vietnamese-viscii-upper
235 ;; ;; R1:position code
236 ;; ;; Out: R1:font code point
237 ;; (translate-character viet-vps-encode-table r0 r1))
238 ;; "CCL program to encode Vietnamese chars to VPS font.")
239
240 (make-coding-system
241 'vietnamese-viscii 4 ?V
242 "8-bit encoding for Vietnamese VISCII 1.1 (MIME:VISCII)"
243 '(ccl-decode-viscii . ccl-encode-viscii)
244 '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
245 (mime-charset . viscii)
246 (valid-codes (0 . 255))))
247
248 (define-coding-system-alias 'viscii 'vietnamese-viscii)
249
250 (make-coding-system
251 'vietnamese-vscii 4 ?v
252 "8-bit encoding for Vietnamese VSCII-1"
253 '(ccl-decode-vscii . ccl-encode-vscii)
254 '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
255 (valid-codes (0 . 255))))
256
257 (define-coding-system-alias 'vscii 'vietnamese-vscii)
258
259 (make-coding-system
260 'vietnamese-tcvn 4 ?t
261 "8-bit encoding for Vietnamese TCVN-5712"
262 '(ccl-decode-tcvn . ccl-encode-tcvn)
263 '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
264 (valid-codes (0 . 255))))
265
266 (define-coding-system-alias 'tcvn 'vietnamese-tcvn)
267
268 ;; (make-coding-system
269 ;; 'vietnamese-vps 4 ?p
270 ;; "8-bit encoding for Vietnamese VPS"
271 ;; '(ccl-decode-vps . ccl-encode-vps)
272 ;; '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
273 ;; (valid-codes (0 . 255))))
274 ;;
275 ;; (define-coding-system-alias 'vps 'vietnamese-vps)
276
277 (make-coding-system
278 'vietnamese-viqr 0 ?q
279 "Vietnamese latin transcription (VIQR)"
280 nil
281 '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
282 (post-read-conversion . viqr-post-read-conversion)
283 (pre-write-conversion . viqr-pre-write-conversion)
284 (charset-origin-alist
285 (vietnamese-viscii-lower "VISCII" viet-encode-viscii-char)
286 (vietnamese-viscii-upper "VISCII" viet-encode-viscii-char))))
287
288
289 (define-coding-system-alias 'viqr 'vietnamese-viqr)
290
291 (setq font-ccl-encoder-alist
292 (cons '("viscii" . ccl-encode-viscii-font) font-ccl-encoder-alist))
293
294 (setq font-ccl-encoder-alist
295 (cons '("vscii" . ccl-encode-vscii-font) font-ccl-encoder-alist))
296
297 (setq font-ccl-encoder-alist
298 (cons '("tcvn" . ccl-encode-tcvn-font) font-ccl-encoder-alist))
299
300 (set-language-info-alist
301 "Vietnamese" `((charset vietnamese-viscii-lower vietnamese-viscii-upper)
302 (nonascii-translation
303 . ,(get 'viet-viscii-nonascii-translation-table
304 'translation-table))
305 (coding-system vietnamese-viscii vietnamese-vscii vietnamese-tcvn
306 vietnamese-viqr)
307 (coding-priority vietnamese-viscii)
308 (input-method . "vietnamese-viqr")
309 (unibyte-display . vietnamese-viscii)
310 (features viet-util)
311 (sample-text . "Vietnamese (Ti\e,1*\e(Bng Vi\e,1.\e(Bt) Ch\e,1`\e(Bo b\e,1U\e(Bn")
312 (documentation . "\
313 For Vietnamese, Emacs uses special charsets internally.
314 They can be decoded from and encoded to VISCII, VSCII, TCVN-5712, and
315 VIQR. VSCII is deprecated in favour of TCVN-5712. Current setting
316 puts higher priority to the coding system VISCII than TCVN-5712. If
317 you prefer TCVN-5712, please do: (prefer-coding-system 'vietnamese-tcvn).
318 There are two Vietnamese input methods: VIQR and Telex, VIQR is the
319 default setting.")
320 ))
321
322 (provide 'vietnamese)
323
324 ;;; vietnamese.el ends here