;;; Code:
-(eval-when-compile
+(eval-and-compile
(defvar viet-viscii-decode-table
[;; VISCII is a full 8-bit code.
?\e,2p\e(B ?\e,1Q\e(B ?\e,2r\e(B ?\e,2s\e(B ?\e,2t\e(B ?\e,1U\e(B ?\e,1V\e(B ?\e,1W\e(B ?\e,1X\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
?\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
?\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 ]
- "Vietnamese VISCII encoding table.")
+ "Vietnamese VISCII decoding table.")
(defvar viet-viscii-encode-table
(let ((table-lower (make-vector 128 0))
(aset table-upper (nth 1 char-component) i)))
(setq i (1+ i)))
(cons table-lower table-upper))
- "Vietnamese VISCII decoding table.
-Cons of tables for decoding lower-case chars and upper-case characterss.
+ "Vietnamese VISCII encoding table.
+Cons of tables for encoding lower-case chars and upper-case characters.
Both tables are indexed by the position code of Vietnamese characters.")
(defvar viet-vscii-decode-table
?\e,1i\e(B ?\e,1)\e(B ?\e,1+\e(B ?\e,1,\e(B ?\e,1-\e(B ?\e,1*\e(B ?\e,1.\e(B ?\e,1l\e(B ?\e,1o\e(B ?\e,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
?\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
?\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]
- "Vietnamese VSCII code table.")
+ "Vietnamese VSCII decoding table.")
(defvar viet-vscii-encode-table
(let ((table-lower (make-vector 128 0))
(aset table-upper (nth 1 char-component) i)))
(setq i (1+ i)))
(cons table-lower table-upper))
- "Vietnamese VSCII decoding table.
-Cons of tables for decoding lower-case chars and upper-case characterss.
+ "Vietnamese VSCII encoding table.
+Cons of tables for encoding lower-case chars and upper-case characters.
Both tables are indexed by the position code of Vietnamese characters.")
)
"8-bit encoding for Vietnamese VISCII 1.1 (MIME:VISCII)"
'(ccl-decode-viscii . ccl-encode-viscii)
'((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
- (mime-charset . viscii)))
+ (mime-charset . viscii)
+ (valid-codes (0 255))))
(define-coding-system-alias 'viscii 'vietnamese-viscii)
'vietnamese-vscii 4 ?v
"8-bit encoding for Vietnamese VSCII-1"
'(ccl-decode-vscii . ccl-encode-vscii)
- '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)))
+ '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
+ (valid-codes (0 255))))
(define-coding-system-alias 'vscii 'vietnamese-vscii)
(setq font-ccl-encoder-alist
(cons (cons "vscii" ccl-encode-vscii-font) font-ccl-encoder-alist))
+(defvar viet-viscii-nonascii-translation-table
+ (make-translation-table-from-vector viet-viscii-decode-table)
+ "Value of `nonascii-translation-table' in Vietnamese language environment.")
+
(set-language-info-alist
- "Vietnamese" '((setup-function . setup-vietnamese-environment)
+ "Vietnamese" `((setup-function . setup-vietnamese-environment)
(charset vietnamese-viscii-lower vietnamese-viscii-upper)
+ (nonascii-translation-table
+ . ,viet-viscii-nonascii-translation-table)
+ (charset-origin-alist
+ (vietnamese-viscii-lower "VISCII" viet-encode-viscii-char)
+ (vietnamese-viscii-upper "VISCII" viet-encode-viscii-char))
(coding-system vietnamese-viscii vietnamese-vscii
vietnamese-viqr)
(coding-priority vietnamese-viscii)