| 1 | ;;; japanese.el --- support for Japanese -*- coding: iso-2022-7bit; -*- |
| 2 | |
| 3 | ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. |
| 4 | ;; Licensed to the Free Software Foundation. |
| 5 | |
| 6 | ;; Keywords: multilingual, Japanese |
| 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 |
| 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. |
| 24 | |
| 25 | ;;; Commentary: |
| 26 | |
| 27 | ;; For Japanese, character sets JISX0201, JISX0208, JISX0212 are |
| 28 | ;; supported. |
| 29 | |
| 30 | ;;; Code: |
| 31 | |
| 32 | (make-coding-system |
| 33 | 'iso-2022-jp 2 ?J |
| 34 | "ISO 2022 based 7bit encoding for Japanese (MIME:ISO-2022-JP)." |
| 35 | '((ascii japanese-jisx0208-1978 japanese-jisx0208 |
| 36 | latin-jisx0201 japanese-jisx0212) nil nil nil |
| 37 | short ascii-eol ascii-cntl seven) |
| 38 | '((safe-charsets ascii japanese-jisx0208-1978 japanese-jisx0208 |
| 39 | latin-jisx0201 japanese-jisx0212) |
| 40 | (mime-charset . iso-2022-jp))) |
| 41 | |
| 42 | (define-coding-system-alias 'junet 'iso-2022-jp) |
| 43 | |
| 44 | (make-coding-system |
| 45 | 'iso-2022-jp-2 2 ?J |
| 46 | "ISO 2022 based 7bit encoding for CJK, Latin-1, and Greek (MIME:ISO-2022-JP-2)." |
| 47 | '((ascii japanese-jisx0208-1978 japanese-jisx0208 |
| 48 | latin-jisx0201 japanese-jisx0212 |
| 49 | chinese-gb2312 korean-ksc5601) nil |
| 50 | (nil latin-iso8859-1 greek-iso8859-7) nil |
| 51 | short ascii-eol ascii-cntl seven nil single-shift nil nil nil init-bol) |
| 52 | '((safe-charsets ascii japanese-jisx0208-1978 japanese-jisx0208 |
| 53 | latin-jisx0201 japanese-jisx0212 |
| 54 | chinese-gb2312 korean-ksc5601 |
| 55 | latin-iso8859-1 greek-iso8859-7) |
| 56 | (mime-charset . iso-2022-jp-2))) |
| 57 | |
| 58 | (make-coding-system |
| 59 | 'japanese-shift-jis 1 ?S |
| 60 | "Shift-JIS 8-bit encoding for Japanese (MIME:SHIFT_JIS)." |
| 61 | nil |
| 62 | '((safe-charsets ascii japanese-jisx0208 japanese-jisx0208-1978 |
| 63 | latin-jisx0201 katakana-jisx0201) |
| 64 | (mime-charset . shift_jis) |
| 65 | (charset-origin-alist (japanese-jisx0208 "SJIS" encode-sjis-char) |
| 66 | (katakana-jisx0201 "SJIS" encode-sjis-char)))) |
| 67 | |
| 68 | (define-coding-system-alias 'shift_jis 'japanese-shift-jis) |
| 69 | (define-coding-system-alias 'sjis 'japanese-shift-jis) |
| 70 | |
| 71 | (make-coding-system |
| 72 | 'japanese-iso-7bit-1978-irv 2 ?j |
| 73 | "ISO 2022 based 7-bit encoding for Japanese JISX0208-1978 and JISX0201-Roman." |
| 74 | '((ascii japanese-jisx0208-1978 japanese-jisx0208 |
| 75 | latin-jisx0201 japanese-jisx0212 katakana-jisx0201 t) nil nil nil |
| 76 | short ascii-eol ascii-cntl seven nil nil use-roman use-oldjis) |
| 77 | '(ascii japanese-jisx0208-1978 japanese-jisx0208 latin-jisx0201)) |
| 78 | |
| 79 | (define-coding-system-alias 'iso-2022-jp-1978-irv 'japanese-iso-7bit-1978-irv) |
| 80 | (define-coding-system-alias 'old-jis 'japanese-iso-7bit-1978-irv) |
| 81 | |
| 82 | (make-coding-system |
| 83 | 'japanese-iso-8bit 2 ?E |
| 84 | "ISO 2022 based EUC encoding for Japanese (MIME:EUC-JP)." |
| 85 | '(ascii japanese-jisx0208 katakana-jisx0201 japanese-jisx0212 |
| 86 | short ascii-eol ascii-cntl nil nil single-shift) |
| 87 | '((safe-charsets ascii latin-jisx0201 japanese-jisx0208 japanese-jisx0208-1978 |
| 88 | katakana-jisx0201 japanese-jisx0212) |
| 89 | (mime-charset . euc-jp))) |
| 90 | |
| 91 | (define-coding-system-alias 'euc-japan-1990 'japanese-iso-8bit) |
| 92 | (define-coding-system-alias 'euc-japan 'japanese-iso-8bit) |
| 93 | (define-coding-system-alias 'euc-jp 'japanese-iso-8bit) |
| 94 | |
| 95 | (set-language-info-alist |
| 96 | "Japanese" '((setup-function . setup-japanese-environment-internal) |
| 97 | (exit-function . exit-japanese-environment) |
| 98 | (tutorial . "TUTORIAL.ja") |
| 99 | (charset japanese-jisx0208 japanese-jisx0208-1978 |
| 100 | japanese-jisx0212 latin-jisx0201 katakana-jisx0201 |
| 101 | japanese-jisx0213-1 japanese-jisx0213-2) |
| 102 | (coding-system iso-2022-jp japanese-iso-8bit |
| 103 | japanese-shift-jis japanese-iso-7bit-1978-irv) |
| 104 | (coding-priority iso-2022-jp japanese-iso-8bit |
| 105 | japanese-shift-jis iso-2022-jp-2) |
| 106 | (input-method . "japanese") |
| 107 | (features japan-util) |
| 108 | (sample-text . "Japanese (\e$BF|K\8l\e(B) \e$B$3$s$K$A$O\e(B, \e(I:]FAJ\e(B") |
| 109 | (documentation . t))) |
| 110 | |
| 111 | (provide 'japanese) |
| 112 | |
| 113 | ;;; japanese.el ends here |