1 ;;; jisx0213.el --- Charset Definition for JIS X 0213
3 ;; Copyright (C) 1999,2000 PFU LIMITED
5 ;; Author: KATAYAMA Yoshio <kate@pfu.co.jp>
7 ;; Maintainer: TOMURA Satoru <tomura@etl.go.jp>
9 ;; Keywords: mule, multilingual, input method
11 ;; This file is part of EGG.
13 ;; EGG is free software; you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by
15 ;; the Free Software Foundation; either version 2, or (at your option)
18 ;; EGG is distributed in the hope that it will be useful,
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;; GNU General Public License for more details.
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26 ;; Boston, MA 02111-1307, USA.
30 ;; This module defines JIS X 0213 character sets if these character
31 ;; sets are not defined. This module also defines fixed-euc-jisx0213
32 ;; coding systems if these coding systems are not defined and can be
37 (if (not (charsetp 'japanese-jisx0213-1))
38 (define-charset 151 'japanese-jisx0213-1
39 [2 94 2 0 ?O 0 "JISX0213-1" "JISX0213-1" "JISX0213-1 (Japanese)"]))
41 (if (not (charsetp 'japanese-jisx0213-2))
42 (define-charset 254 'japanese-jisx0213-2
43 [2 94 2 0 ?P 0 "JISX0213-2" "JISX0213-2" "JISX0213-2 (Japanese)"]))
45 ;; Mule-UCS is required to adopt fixed-euc-jisx0213.
47 noninteractive ;; unnecessary in non-interactive mode.
48 (unless (or (require 'jisx0213)
49 (get 'jisx0213-to-jisx0208/0212 'translation-table))
50 (message "Mule-UCS not installed."))
51 (coding-system-p 'fixed-euc-jisx0213)
54 (define-ccl-program ccl-decode-fixed-euc-jisx0213
56 ((r3 = ,(charset-id 'katakana-jisx0201))
57 (loop ;; ascii kana 212 208
58 (read r0) ;; r0 - 0 0 h h
59 (read r1) ;; r1 - l h l h
69 (r2 = ,(charset-id 'japanese-jisx0213-1)))
70 (r2 = ,(charset-id 'japanese-jisx0213-2)))
72 (translate-character jisx0213-to-jisx0208/0212 r2 r0)
73 (write-multibyte-character r2 r0)
77 (define-ccl-program ccl-encode-fixed-euc-jisx0213
80 (read-multibyte-character r0 r1)
81 (r6 = (r0 == ,(charset-id 'ascii))) ;G0
82 (r6 |= (r0 == ,(charset-id 'latin-jisx0201)))
86 (r6 = (r0 == ,(charset-id 'japanese-jisx0208)))
87 (r6 |= (r0 == ,(charset-id 'japanese-jisx0208-1978)))
88 (r6 |= (r0 == ,(charset-id 'japanese-jisx0213-1)))
92 (write ((r1 & ?\x7f) | ?\x80))
94 (if (r0 == ,(charset-id 'katakana-jisx0201)) ;G2
98 (r6 = (r0 == ,(charset-id 'japanese-jisx0212))) ;G3
99 (r6 |= (r0 == ,(charset-id 'japanese-jisx0213-2)))
108 'fixed-euc-jisx0213 4 ?W "Coding System for fixed EUC Japanese"
109 (cons ccl-decode-fixed-euc-jisx0213 ccl-encode-fixed-euc-jisx0213))))