1 ;;; -*- coding: iso-2022-7bit -*-
2 ;;; big5c-cns.el --- Definition module for conversion of BIG5
3 ;;; directly mapped to mainly CNS charsets.
5 ;; Copyright (C) 1999 Miyashita Hisashi
7 ;; Keywords: mule, multilingual,
8 ;; MULE-UCS, Big5, CNS, Traditional Chinese
10 ;; This file is part of MULE-UCS
12 ;; MULE-UCS 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)
17 ;; MULE-UCS 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.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with this program; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 ;; Boston, MA 02111-1307, USA.
27 (defvar big5-conv-cns-coding-system-alist
35 (mime-charset . cn-big5))
36 "An alist for big5-conv coding systems.")
40 (mucs-require-supplement 'big5conv 'big5c-cns)
42 (tae-declare-translation
43 'big5-conv-cns-translation
44 `(| ,big5conv-ascii-assoc
45 ,big5conv-emacs-char-1-vs-big5-assoc))
47 (tae-declare-translation
48 'big5-conv-cns-mac-translation
49 `(| (assoc (char-1 . big5)
51 big5-conv-cns-translation))
53 (defun big5-conv-cns-decode-template (tr read write)
55 (mucs-ccl-read 'big5 read)
57 (mucs-ccl-write write)))
59 (defun big5-conv-cns-encode-template (tr read write)
61 (mucs-ccl-read 'char-1 read)
63 (mucs-ccl-write write)))
68 ;; coding system definitions.
75 ;; conversion definition.
78 ;;; For stream conversion.
81 (mucs-define-conversion
82 big5-conv-cns-unix-stream-encoder
84 (big5conv-encode-buffer-magnification
85 ((big5-conv-cns-encode-template
86 'big5-conv-cns-translation 'emacs-mule 'big5-be-2-octet))))
87 (mucs-define-conversion
88 big5-conv-cns-unix-stream-decoder
90 (big5conv-decode-buffer-magnification
91 ((big5-conv-cns-decode-template
92 'big5-conv-cns-translation 'big5-be-2-octet 'emacs-mule))))
95 (mucs-define-conversion
96 big5-conv-cns-dos-stream-encoder
98 (big5conv-encode-buffer-magnification
99 ((big5-conv-cns-encode-template
100 'big5-conv-cns-translation 'emacs-mule 'big5-be-2-octet-dos))))
101 (mucs-define-conversion
102 big5-conv-cns-dos-stream-decoder
104 (big5conv-decode-buffer-magnification
105 ((big5-conv-cns-decode-template
106 'big5-conv-cns-translation 'big5-be-2-octet 'emacs-mule-dos))))
109 (mucs-define-conversion
110 big5-conv-cns-mac-stream-encoder
112 (big5conv-encode-buffer-magnification
113 ((big5-conv-cns-encode-template
114 'big5-conv-cns-mac-translation 'emacs-mule 'big5-be-2-octet))))
115 (mucs-define-conversion
116 big5-conv-cns-mac-stream-decoder
118 (big5conv-decode-buffer-magnification
119 ((big5-conv-cns-decode-template
120 'big5-conv-cns-mac-translation 'big5-be-2-octet 'emacs-mule))))
123 ;; coding-system-definition.
125 (mucs-define-coding-system
127 "Big5 coding system which convert Big5 characters to mainly CNS ones."
128 'big5-conv-cns-unix-stream-decoder
129 'big5-conv-cns-unix-stream-encoder
130 big5-conv-cns-coding-system-alist
133 (mucs-define-coding-system
135 "Big5 coding system which convert Big5 characters to mainly CNS ones."
136 'big5-conv-cns-dos-stream-decoder
137 'big5-conv-cns-dos-stream-encoder
138 big5-conv-cns-coding-system-alist
141 (mucs-define-coding-system
143 "Big5 coding system which convert Big5 characters to mainly CNS ones."
144 'big5-conv-cns-mac-stream-decoder
145 'big5-conv-cns-mac-stream-encoder
146 big5-conv-cns-coding-system-alist
149 (mucs-define-coding-system
151 "Big5 coding system which convert Big5 characters to mainly CNS ones."
152 'big5-conv-cns-unix-stream-decoder
153 'big5-conv-cns-unix-stream-encoder
154 big5-conv-cns-coding-system-alist
155 '[big5-conv-unix big5-conv-dos big5-conv-mac])
159 (coding-system-put x 'alias-coding-systems '(big5-conv)))
160 '(big5-conv big5-conv-dos big5-conv-unix big5-conv-mac))
162 ) ;; big5c-cns package definition ends here
164 ;; set up coding category
165 (if (boundp 'coding-category-big5)
166 (setq coding-category-big5 'big5-conv))