New directory
[bpt/emacs.git] / lisp / language / vietnamese.el
CommitLineData
60370d40 1;;; vietnamese.el --- support for Vietnamese -*- coding: iso-2022-7bit; -*-
4ed46869 2
4ed46869 3;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
fa526c4a 4;; Licensed to the Free Software Foundation.
4ed46869
KH
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
369314dc
KH
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.
4ed46869
KH
24
25;;; Commentary:
26
bd465aec
PJ
27;; For Vietnames, the character sets VISCII, VSCII and TCVN-5712 are
28;; supported.
4ed46869
KH
29
30;;; Code:
31
4ed46869
KH
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
a1506d29 41 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
4ed46869
KH
42 ?\e,2U\e(B ?\e,2!\e(B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(B ?\e,1_\e(B
48 ?\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
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 ]
d0307626 50 "Vietnamese VISCII decoding table.")
4ed46869 51
0d833551
KH
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)))
4ed46869 56
bd465aec
PJ
57;;;
58;;; VSCII is a pre-version of TCVN-5712 and deprecated
59;;;
4ed46869
KH
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
a1506d29 69 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
4ed46869
KH
70 ?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(B
76 ?\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
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]
d0307626 78 "Vietnamese VSCII decoding table.")
4ed46869 79
0d833551
KH
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)))
4ed46869 84
bd465aec
PJ
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
a1506d29 95 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
bd465aec
PJ
96 ?\e,2`\e(B ?\e,2d\e(B ?\e,2c\e(B ?\e,2a\e(B ?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\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
103 ?\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]
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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,1l\e(B ?\e,1m\e(B 238 ?\e,1n\e(B
128;; ?\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]
129;; "Vietnamese VPS decoding table.")
a1506d29 130;;
bd465aec
PJ
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
4ed46869
KH
136(define-ccl-program ccl-decode-viscii
137 `(3
0d833551
KH
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))))
4ed46869
KH
144 "CCL program to decode VISCII 1.1")
145
4ed46869
KH
146(define-ccl-program ccl-encode-viscii
147 `(1
0d833551
KH
148 ((loop
149 (read-multibyte-character r0 r1)
150 (translate-character viet-viscii-encode-table r0 r1)
151 (write-repeat r1))))
4ed46869
KH
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
0d833551 159 (translate-character viet-viscii-encode-table r0 r1))
4ed46869
KH
160 "CCL program to encode Vietnamese chars to VISCII 1.1 font")
161
162(define-ccl-program ccl-decode-vscii
163 `(3
0d833551
KH
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))))
4ed46869
KH
170 "CCL program to decode VSCII-1.")
171
172(define-ccl-program ccl-encode-vscii
173 `(1
0d833551
KH
174 ((loop
175 (read-multibyte-character r0 r1)
176 (translate-character viet-vscii-encode-table r0 r1)
177 (write-repeat r1))))
4ed46869
KH
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
0d833551 185 (translate-character viet-vscii-encode-table r0 r1))
4ed46869
KH
186 "CCL program to encode Vietnamese chars to VSCII-1 font.")
187
bd465aec
PJ
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.")
a1506d29 223;;
bd465aec
PJ
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.")
a1506d29 231;;
bd465aec
PJ
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.")
4ed46869
KH
239
240(make-coding-system
4b9121fc 241 'vietnamese-viscii 4 ?V
bd465aec 242 "8-bit encoding for Vietnamese VISCII 1.1 (MIME:VISCII)"
7fbf766f 243 '(ccl-decode-viscii . ccl-encode-viscii)
a79a3c79 244 '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
d0307626 245 (mime-charset . viscii)
c11b3a3f 246 (valid-codes (0 . 255))))
4ed46869 247
2e21aa27 248(define-coding-system-alias 'viscii 'vietnamese-viscii)
4b9121fc 249
4ed46869 250(make-coding-system
4b9121fc 251 'vietnamese-vscii 4 ?v
bd465aec 252 "8-bit encoding for Vietnamese VSCII-1"
7fbf766f 253 '(ccl-decode-vscii . ccl-encode-vscii)
d0307626 254 '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
c11b3a3f 255 (valid-codes (0 . 255))))
4ed46869 256
2e21aa27 257(define-coding-system-alias 'vscii 'vietnamese-vscii)
4b9121fc 258
bd465aec
PJ
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))))
a1506d29 274;;
bd465aec
PJ
275;; (define-coding-system-alias 'vps 'vietnamese-vps)
276
4ed46869 277(make-coding-system
4b9121fc 278 'vietnamese-viqr 0 ?q
bd465aec 279 "Vietnamese latin transcription (VIQR)"
c8f0d090 280 nil
a79a3c79
KH
281 '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
282 (post-read-conversion . viqr-post-read-conversion)
909a166d
KH
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
4b9121fc 288
2e21aa27 289(define-coding-system-alias 'viqr 'vietnamese-viqr)
4ed46869
KH
290
291(setq font-ccl-encoder-alist
0d833551 292 (cons '("viscii" . ccl-encode-viscii-font) font-ccl-encoder-alist))
4ed46869
KH
293
294(setq font-ccl-encoder-alist
0d833551 295 (cons '("vscii" . ccl-encode-vscii-font) font-ccl-encoder-alist))
d0307626 296
bd465aec
PJ
297(setq font-ccl-encoder-alist
298 (cons '("tcvn" . ccl-encode-tcvn-font) font-ccl-encoder-alist))
299
4ed46869 300(set-language-info-alist
a564ccf9
KH
301 "Vietnamese" `((charset vietnamese-viscii-lower vietnamese-viscii-upper)
302 (nonascii-translation
0d833551
KH
303 . ,(get 'viet-viscii-nonascii-translation-table
304 'translation-table))
bd465aec 305 (coding-system vietnamese-viscii vietnamese-vscii vietnamese-tcvn
a79a3c79
KH
306 vietnamese-viqr)
307 (coding-priority vietnamese-viscii)
a564ccf9
KH
308 (input-method . "vietnamese-viqr")
309 (unibyte-display . vietnamese-viscii)
310 (features viet-util)
dc09922d 311 (sample-text . "Vietnamese (Ti\e,1*\e(Bng Vi\e,1.\e(Bt) Ch\e,1`\e(Bo b\e,1U\e(Bn")
335a7ad7 312 (documentation . "\
ae0fa1e0 313For Vietnamese, Emacs uses special charsets internally.
bd465aec
PJ
314They can be decoded from and encoded to VISCII, VSCII, TCVN-5712, and
315VIQR. VSCII is deprecated in favour of TCVN-5712. Current setting
ae0fa1e0 316puts higher priority to the coding system VISCII than TCVN-5712. If
bd465aec
PJ
317you prefer TCVN-5712, please do: (prefer-coding-system 'vietnamese-tcvn).
318There are two Vietnamese input methods: VIQR and Telex, VIQR is the
319default setting.")
78eee0ed 320 ))
4ed46869 321
41da80b1
DL
322(provide 'vietnamese)
323
4ed46869 324;;; vietnamese.el ends here