]> code.delx.au - gnu-emacs/blob - lisp/language/vietnamese.el
Merge from emacs--devo--0
[gnu-emacs] / lisp / language / vietnamese.el
1 ;;; vietnamese.el --- support for Vietnamese -*- coding: iso-2022-7bit; -*-
2
3 ;; Copyright (C) 1998, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
4 ;; Free Software Foundation, Inc.
5 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
6 ;; 2005, 2006, 2007, 2008
7 ;; National Institute of Advanced Industrial Science and Technology (AIST)
8 ;; Registration Number H14PRO021
9 ;; Copyright (C) 2003
10 ;; National Institute of Advanced Industrial Science and Technology (AIST)
11 ;; Registration Number H13PRO009
12
13 ;; Keywords: multilingual, Vietnamese, i18n
14
15 ;; This file is part of GNU Emacs.
16
17 ;; GNU Emacs is free software; you can redistribute it and/or modify
18 ;; it under the terms of the GNU General Public License as published by
19 ;; the Free Software Foundation; either version 3, or (at your option)
20 ;; any later version.
21
22 ;; GNU Emacs is distributed in the hope that it will be useful,
23 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
24 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ;; GNU General Public License for more details.
26
27 ;; You should have received a copy of the GNU General Public License
28 ;; along with GNU Emacs; see the file COPYING. If not, write to the
29 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
30 ;; Boston, MA 02110-1301, USA.
31
32 ;;; Commentary:
33
34 ;; For Vietnames, the character sets VISCII, VSCII and TCVN-5712 are
35 ;; supported.
36
37 ;;; Code:
38
39 (define-coding-system 'vietnamese-viscii
40 "8-bit encoding for Vietnamese VISCII 1.1 (MIME:VISCII)."
41 :coding-type 'charset
42 :mnemonic ?V
43 :charset-list '(viscii)
44 :mime-charset 'viscii
45 :suitable-for-file-name t)
46
47 (define-coding-system-alias 'viscii 'vietnamese-viscii)
48
49 (define-coding-system 'vietnamese-vscii
50 "8-bit encoding for Vietnamese VSCII-1."
51 :coding-type 'charset
52 :mnemonic ?v
53 :charset-list '(vscii)
54 :suitable-for-file-name t)
55
56 (define-coding-system-alias 'vscii 'vietnamese-vscii)
57
58 ;; (make-coding-system
59 ;; 'vietnamese-vps 4 ?p
60 ;; "8-bit encoding for Vietnamese VPS"
61 ;; '(ccl-decode-vps . ccl-encode-vps)
62 ;; '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
63 ;; (valid-codes (0 . 255))))
64 ;;
65 ;; (define-coding-system-alias 'vps 'vietnamese-vps)
66
67 (define-coding-system 'vietnamese-viqr
68 "Vietnamese latin transcription (VIQR)."
69 :coding-type 'utf-8
70 :mnemonic ?q
71 :charset-list '(ascii viscii)
72 :post-read-conversion 'viqr-post-read-conversion
73 :pre-write-conversion 'viqr-pre-write-conversion)
74
75 (define-coding-system-alias 'viqr 'vietnamese-viqr)
76
77 (set-language-info-alist
78 "Vietnamese" `((charset viscii)
79 (coding-system vietnamese-viscii vietnamese-vscii
80 vietnamese-tcvn vietnamese-viqr windows-1258)
81 (nonascii-translation . viscii)
82 (coding-priority vietnamese-viscii)
83 (input-method . "vietnamese-viqr")
84 (unibyte-display . vietnamese-viscii)
85 (features viet-util)
86 (sample-text . "Vietnamese (Ti\e,1*\e(Bng Vi\e,1.\e(Bt) Ch\e,1`\e(Bo b\e,1U\e(Bn")
87 (documentation . "\
88 For Vietnamese, Emacs uses special charsets internally.
89 They can be decoded from and encoded to VISCII, VSCII, TCVN-5712, VIQR
90 and windows-1258. VSCII is deprecated in favour of TCVN-5712. The
91 Current setting gives higher priority to the coding system VISCII than
92 TCVN-5712. If you prefer TCVN-5712, please do: (prefer-coding-system
93 'vietnamese-tcvn). There are two Vietnamese input methods: VIQR and
94 Telex, VIQR is the default setting.")))
95
96 (define-coding-system 'windows-1258
97 "windows-1258 encoding for Vietnamese (MIME: WINDOWS-1258)"
98 :coding-type 'charset
99 :mnemonic ?*
100 :charset-list '(windows-1258)
101 :mime-charset 'windows-1258)
102 (define-coding-system-alias 'cp1258 'windows-1258)
103
104 (define-coding-system 'vietnamese-tcvn
105 "8-bit encoding for Vietnamese TCVN-5712"
106 :coding-type 'charset
107 :mnemonic ?t
108 :charset-list '(tcvn-5712)
109 :suitable-for-file-name t)
110 (define-coding-system-alias 'tcvn 'vietnamese-tcvn)
111 (define-coding-system-alias 'tcvn-5712 'vietnamese-tcvn)
112
113 (provide 'vietnamese)
114
115 ;;; arch-tag: 5bd4f1aa-2d4e-4f33-b7d8-0679c6a19ee6
116 ;;; vietnamese.el ends here