(defgroup reftex): Update home page url-link.
[bpt/emacs.git] / lisp / language / vietnamese.el
CommitLineData
60370d40 1;;; vietnamese.el --- support for Vietnamese -*- coding: iso-2022-7bit; -*-
4ed46869 2
eaa61218
KH
3;; Copyright (C) 1998, 2002 Free Software Foundation, Inc.
4;; Copyright (C) 1995, 1997, 1998, 2000
5;; National Institute of Advanced Industrial Science and Technology (AIST)
6;; Registration Number H14PRO021
4ed46869
KH
7
8;; Keywords: multilingual, Vietnamese
9
10;; This file is part of GNU Emacs.
11
12;; GNU Emacs is free software; you can redistribute it and/or modify
13;; it under the terms of the GNU General Public License as published by
14;; the Free Software Foundation; either version 2, or (at your option)
15;; any later version.
16
17;; GNU Emacs is distributed in the hope that it will be useful,
18;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;; GNU General Public License for more details.
21
22;; You should have received a copy of the GNU General Public License
369314dc 23;; along with GNU Emacs; see the file COPYING. If not, write to the
3a35cf56
LK
24;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25;; Boston, MA 02110-1301, USA.
4ed46869
KH
26
27;;; Commentary:
28
bd465aec
PJ
29;; For Vietnames, the character sets VISCII, VSCII and TCVN-5712 are
30;; supported.
4ed46869
KH
31
32;;; Code:
33
4ed46869
KH
34(defvar viet-viscii-decode-table
35 [;; VISCII is a full 8-bit code.
36 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
37 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
38 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
39 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
40 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
41 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
42 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
a1506d29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\e(B ?\e,2y\e(B ?\e,2z\e(B ?\e,1[\e(B ?\e,1\\e(B ?\e,2}\e(B ?\e,1^\e(B ?\e,1_\e(B
50 ?\e,1`\e(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
51 ?\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 ]
d0307626 52 "Vietnamese VISCII decoding table.")
4ed46869 53
0d833551
KH
54(let ((table (make-translation-table-from-vector viet-viscii-decode-table)))
55 (define-translation-table 'viet-viscii-nonascii-translation-table table)
56 (define-translation-table 'viet-viscii-encode-table
57 (char-table-extra-slot table 0)))
4ed46869 58
bd465aec
PJ
59;;;
60;;; VSCII is a pre-version of TCVN-5712 and deprecated
61;;;
4ed46869
KH
62(defvar viet-vscii-decode-table
63 [;; VSCII is a full 8-bit code.
64 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
65 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
66 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
67 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
68 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
69 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
70 96 97 98 99 100 101 102 103 104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2-\e(B ?\e,2*\e(B ?\e,20\e(B ?\e,1n\e(B ?\e,1m\e(B ?\e,18\e(B ?\e,1r\e(B
78 ?\e,21\e(B ?\e,1v\e(B ?\e,1u\e(B ?\e,1s\e(B ?\e,1w\e(B ?\e,10\e(B ?\e,11\e(B ?\e,12\e(B ?\e,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
79 ?\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]
d0307626 80 "Vietnamese VSCII decoding table.")
4ed46869 81
0d833551
KH
82(let ((table (make-translation-table-from-vector viet-vscii-decode-table)))
83 (define-translation-table 'viet-vscii-nonascii-translation-table table)
84 (define-translation-table 'viet-vscii-encode-table
85 (char-table-extra-slot table 0)))
4ed46869 86
bd465aec
PJ
87;; Does not support combining characters in the range [176, 180]
88(defvar viet-tcvn-decode-table
89 [;; TCVN is a full 8-bit code.
90 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
91 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
92 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
93 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
94 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
95 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
96 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
a1506d29 97 112 113 114 115 116 117 118 119 120 121 122 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\e,1r\e(B
104 ?\e,21\e(B ?\e,1v\e(B ?\e,1u\e(B ?\e,1s\e(B ?\e,1w\e(B ?\e,10\e(B ?\e,11\e(B ?\e,12\e(B ?\e,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
105 ?\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]
106 "Vietnamese TCVN-5712 decoding table.")
107
108(let ((table (make-translation-table-from-vector viet-tcvn-decode-table)))
109 (define-translation-table 'viet-tcvn-nonascii-translation-table table)
110 (define-translation-table 'viet-tcvn-encode-table
111 (char-table-extra-slot table 0)))
112
113;; (defvar viet-vps-decode-table
114;; [;; VPS is a full 8-bit code.
115;; 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
116;; ?\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
117;; 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
118;; 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
119;; 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
120;; 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
121;; 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
122;; 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
123;; ?\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,1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1U\e(B ?\e,1e\e(B 231 ?\e,1h\e(B ?\e,1i\e(B ?\e,1j\e(B ?\e,1(\e(B ?\e,1l\e(B ?\e,1m\e(B 238 ?\e,1n\e(B
130;; ?\e,2G\e(B ?\e,2p\e(B ?\e,1r\e(B ?\e,1s\e(B ?\e,1t\e(B ?\e,1u\e(B 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]
131;; "Vietnamese VPS decoding table.")
a1506d29 132;;
bd465aec
PJ
133;; (let ((table (make-translation-table-from-vector viet-vps-decode-table)))
134;; (define-translation-table 'viet-vps-nonascii-translation-table table)
135;; (define-translation-table 'viet-vps-encode-table
136;; (char-table-extra-slot table 0)))
137
4ed46869
KH
138(define-ccl-program ccl-decode-viscii
139 `(3
0d833551
KH
140 ((loop
141 (r0 = 0)
142 (read r1)
143 (translate-character viet-viscii-nonascii-translation-table r0 r1)
144 (write-multibyte-character r0 r1)
145 (repeat))))
4ed46869
KH
146 "CCL program to decode VISCII 1.1")
147
4ed46869
KH
148(define-ccl-program ccl-encode-viscii
149 `(1
0d833551
KH
150 ((loop
151 (read-multibyte-character r0 r1)
152 (translate-character viet-viscii-encode-table r0 r1)
153 (write-repeat r1))))
4ed46869
KH
154 "CCL program to encode VISCII 1.1")
155
156(define-ccl-program ccl-encode-viscii-font
157 `(0
158 ;; In: R0:vietnamese-viscii-lower/vietnamese-viscii-upper
159 ;; R1:position code
160 ;; Out: R1:font code point
0d833551 161 (translate-character viet-viscii-encode-table r0 r1))
4ed46869
KH
162 "CCL program to encode Vietnamese chars to VISCII 1.1 font")
163
164(define-ccl-program ccl-decode-vscii
165 `(3
0d833551
KH
166 ((loop
167 (r0 = 0)
168 (read r1)
169 (translate-character viet-vscii-nonascii-translation-table r0 r1)
170 (write-multibyte-character r0 r1)
171 (repeat))))
4ed46869
KH
172 "CCL program to decode VSCII-1.")
173
174(define-ccl-program ccl-encode-vscii
175 `(1
0d833551
KH
176 ((loop
177 (read-multibyte-character r0 r1)
178 (translate-character viet-vscii-encode-table r0 r1)
179 (write-repeat r1))))
4ed46869
KH
180 "CCL program to encode VSCII-1.")
181
182(define-ccl-program ccl-encode-vscii-font
183 `(0
184 ;; In: R0:vietnamese-viscii-lower/vietnamese-viscii-upper
185 ;; R1:position code
186 ;; Out: R1:font code point
0d833551 187 (translate-character viet-vscii-encode-table r0 r1))
4ed46869
KH
188 "CCL program to encode Vietnamese chars to VSCII-1 font.")
189
bd465aec
PJ
190(define-ccl-program ccl-decode-tcvn
191 `(3
192 ((loop
193 (r0 = 0)
194 (read r1)
195 (translate-character viet-tcvn-nonascii-translation-table r0 r1)
196 (write-multibyte-character r0 r1)
197 (repeat))))
198 "CCL program to decode TCVN-5712.")
199
200(define-ccl-program ccl-encode-tcvn
201 `(1
202 ((loop
203 (read-multibyte-character r0 r1)
204 (translate-character viet-tcvn-encode-table r0 r1)
205 (write-repeat r1))))
206 "CCL program to encode TCVN-5712.")
207
208(define-ccl-program ccl-encode-tcvn-font
209 `(0
210 ;; In: R0:vietnamese-viscii-lower/vietnamese-viscii-upper
211 ;; R1:position code
212 ;; Out: R1:font code point
213 (translate-character viet-tcvn-encode-table r0 r1))
214 "CCL program to encode Vietnamese chars to TCVN-5712 font.")
215
216;; (define-ccl-program ccl-decode-vps
217;; `(3
218;; ((loop
219;; (r0 = 0)
220;; (read r1)
221;; (translate-character viet-vps-nonascii-translation-table r0 r1)
222;; (write-multibyte-character r0 r1)
223;; (repeat))))
224;; "CCL program to decode VPS.")
a1506d29 225;;
bd465aec
PJ
226;; (define-ccl-program ccl-encode-vps
227;; `(1
228;; ((loop
229;; (read-multibyte-character r0 r1)
230;; (translate-character viet-vps-encode-table r0 r1)
231;; (write-repeat r1))))
232;; "CCL program to encode VPS.")
a1506d29 233;;
bd465aec
PJ
234;; (define-ccl-program ccl-encode-vps-font
235;; `(0
236;; ;; In: R0:vietnamese-viscii-lower/vietnamese-viscii-upper
237;; ;; R1:position code
238;; ;; Out: R1:font code point
239;; (translate-character viet-vps-encode-table r0 r1))
240;; "CCL program to encode Vietnamese chars to VPS font.")
4ed46869
KH
241
242(make-coding-system
4b9121fc 243 'vietnamese-viscii 4 ?V
bd465aec 244 "8-bit encoding for Vietnamese VISCII 1.1 (MIME:VISCII)"
7fbf766f 245 '(ccl-decode-viscii . ccl-encode-viscii)
a79a3c79 246 '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
d0307626 247 (mime-charset . viscii)
c11b3a3f 248 (valid-codes (0 . 255))))
4ed46869 249
2e21aa27 250(define-coding-system-alias 'viscii 'vietnamese-viscii)
4b9121fc 251
4ed46869 252(make-coding-system
4b9121fc 253 'vietnamese-vscii 4 ?v
bd465aec 254 "8-bit encoding for Vietnamese VSCII-1"
7fbf766f 255 '(ccl-decode-vscii . ccl-encode-vscii)
d0307626 256 '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
c11b3a3f 257 (valid-codes (0 . 255))))
4ed46869 258
2e21aa27 259(define-coding-system-alias 'vscii 'vietnamese-vscii)
4b9121fc 260
bd465aec
PJ
261(make-coding-system
262 'vietnamese-tcvn 4 ?t
263 "8-bit encoding for Vietnamese TCVN-5712"
264 '(ccl-decode-tcvn . ccl-encode-tcvn)
265 '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
266 (valid-codes (0 . 255))))
267
268(define-coding-system-alias 'tcvn 'vietnamese-tcvn)
eabcdf2f 269(define-coding-system-alias 'tcvn-5712 'vietnamese-tcvn)
bd465aec
PJ
270
271;; (make-coding-system
272;; 'vietnamese-vps 4 ?p
273;; "8-bit encoding for Vietnamese VPS"
274;; '(ccl-decode-vps . ccl-encode-vps)
275;; '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
276;; (valid-codes (0 . 255))))
a1506d29 277;;
bd465aec
PJ
278;; (define-coding-system-alias 'vps 'vietnamese-vps)
279
4ed46869 280(make-coding-system
4b9121fc 281 'vietnamese-viqr 0 ?q
bd465aec 282 "Vietnamese latin transcription (VIQR)"
c8f0d090 283 nil
a79a3c79
KH
284 '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
285 (post-read-conversion . viqr-post-read-conversion)
909a166d
KH
286 (pre-write-conversion . viqr-pre-write-conversion)
287 (charset-origin-alist
288 (vietnamese-viscii-lower "VISCII" viet-encode-viscii-char)
289 (vietnamese-viscii-upper "VISCII" viet-encode-viscii-char))))
290
4b9121fc 291
2e21aa27 292(define-coding-system-alias 'viqr 'vietnamese-viqr)
4ed46869
KH
293
294(setq font-ccl-encoder-alist
0d833551 295 (cons '("viscii" . ccl-encode-viscii-font) font-ccl-encoder-alist))
4ed46869
KH
296
297(setq font-ccl-encoder-alist
0d833551 298 (cons '("vscii" . ccl-encode-vscii-font) font-ccl-encoder-alist))
d0307626 299
bd465aec
PJ
300(setq font-ccl-encoder-alist
301 (cons '("tcvn" . ccl-encode-tcvn-font) font-ccl-encoder-alist))
302
4ed46869 303(set-language-info-alist
a564ccf9
KH
304 "Vietnamese" `((charset vietnamese-viscii-lower vietnamese-viscii-upper)
305 (nonascii-translation
0d833551
KH
306 . ,(get 'viet-viscii-nonascii-translation-table
307 'translation-table))
bd465aec 308 (coding-system vietnamese-viscii vietnamese-vscii vietnamese-tcvn
a79a3c79
KH
309 vietnamese-viqr)
310 (coding-priority vietnamese-viscii)
a564ccf9
KH
311 (input-method . "vietnamese-viqr")
312 (unibyte-display . vietnamese-viscii)
313 (features viet-util)
dc09922d 314 (sample-text . "Vietnamese (Ti\e,1*\e(Bng Vi\e,1.\e(Bt) Ch\e,1`\e(Bo b\e,1U\e(Bn")
335a7ad7 315 (documentation . "\
ae0fa1e0 316For Vietnamese, Emacs uses special charsets internally.
bd465aec
PJ
317They can be decoded from and encoded to VISCII, VSCII, TCVN-5712, and
318VIQR. VSCII is deprecated in favour of TCVN-5712. Current setting
ae0fa1e0 319puts higher priority to the coding system VISCII than TCVN-5712. If
bd465aec
PJ
320you prefer TCVN-5712, please do: (prefer-coding-system 'vietnamese-tcvn).
321There are two Vietnamese input methods: VIQR and Telex, VIQR is the
322default setting.")
78eee0ed 323 ))
4ed46869 324
41da80b1
DL
325(provide 'vietnamese)
326
ab5796a9 327;;; arch-tag: 5bd4f1aa-2d4e-4f33-b7d8-0679c6a19ee6
4ed46869 328;;; vietnamese.el ends here