diff options
| author | Kenichi Handa | 2004-01-27 02:39:40 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2004-01-27 02:39:40 +0000 |
| commit | 3edfae2a64346cf68c9d08f31c3db1d7319f739e (patch) | |
| tree | e1fb4aedc66287773e17f21f9e4b83348c82fb89 | |
| parent | a6f87d34c87c16072f46cb377a0bd8f13f57d021 (diff) | |
| download | emacs-3edfae2a64346cf68c9d08f31c3db1d7319f739e.tar.gz emacs-3edfae2a64346cf68c9d08f31c3db1d7319f739e.zip | |
Load cp51932 and eucjp-ms.
(japanese-ucs-cp932-map, japanese-ucs-jis-map)
(japanese-ucs-glibc-map): New translation tables.
(eucjp-ms): New coding system.
| -rw-r--r-- | lisp/language/japanese.el | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/lisp/language/japanese.el b/lisp/language/japanese.el index a860450065b..592b9d151c4 100644 --- a/lisp/language/japanese.el +++ b/lisp/language/japanese.el | |||
| @@ -32,6 +32,10 @@ | |||
| 32 | 32 | ||
| 33 | ;;; Code: | 33 | ;;; Code: |
| 34 | 34 | ||
| 35 | ;;; Load translation tables for CP932. | ||
| 36 | (load "international/cp51932") | ||
| 37 | (load "international/eucjp-ms") | ||
| 38 | |||
| 35 | (define-coding-system 'iso-2022-jp | 39 | (define-coding-system 'iso-2022-jp |
| 36 | "ISO 2022 based 7bit encoding for Japanese (MIME:ISO-2022-JP)." | 40 | "ISO 2022 based 7bit encoding for Japanese (MIME:ISO-2022-JP)." |
| 37 | :coding-type 'iso-2022 | 41 | :coding-type 'iso-2022 |
| @@ -64,6 +68,26 @@ | |||
| 64 | latin-iso8859-1 greek-iso8859-7) | 68 | latin-iso8859-1 greek-iso8859-7) |
| 65 | :mime-charset 'iso-2022-jp-2) | 69 | :mime-charset 'iso-2022-jp-2) |
| 66 | 70 | ||
| 71 | (let ((map ; SJIS vs CP932 | ||
| 72 | '((#x301C . #xFF5E) ; WAVE DASH FULLWIDTH TILDE | ||
| 73 | (#x2016 . #x2225) ; DOUBLE VERTICAL LINE PARALLEL TO | ||
| 74 | (#x2212 . #xFF0D) ; MINUS SIGN FULLWIDTH HYPHEN-MINUS | ||
| 75 | (#x00A2 . #xFFE0) ; CENT SIGN FULLWIDTH CENT SIGN | ||
| 76 | (#x00A3 . #xFFE1) ; POUND SIGN FULLWIDTH POUND SIGN | ||
| 77 | (#x00AC . #xFFE2) ; NOT SIGN FULLWIDTH NOT SIGN | ||
| 78 | ))) | ||
| 79 | (define-translation-table 'japanese-ucs-cp932-map map) | ||
| 80 | (mapc #'(lambda (x) (let ((tmp (car x))) | ||
| 81 | (setcar x (cdr x)) (setcdr x tmp))) | ||
| 82 | map) | ||
| 83 | (define-translation-table 'japanese-ucs-jis-map map) | ||
| 84 | (define-translation-table 'japanese-ucs-glibc-map map)) | ||
| 85 | |||
| 86 | ;; U+2014 (EM DASH) vs U+2015 (HORIZONTAL BAR) | ||
| 87 | (aset (get 'japanese-ucs-cp932-map 'translation-table) #x2014 #x2015) | ||
| 88 | (aset (get 'japanese-ucs-jis-map 'translation-table) #x2015 #x2014) | ||
| 89 | (aset (get 'japanese-ucs-glibc-map 'translation-table) #x2014 #x2015) | ||
| 90 | |||
| 67 | (define-coding-system 'japanese-shift-jis | 91 | (define-coding-system 'japanese-shift-jis |
| 68 | "Shift-JIS 8-bit encoding for Japanese (MIME:SHIFT_JIS)" | 92 | "Shift-JIS 8-bit encoding for Japanese (MIME:SHIFT_JIS)" |
| 69 | :coding-type 'shift-jis | 93 | :coding-type 'shift-jis |
| @@ -82,10 +106,6 @@ | |||
| 82 | 106 | ||
| 83 | (define-coding-system-alias 'cp932 'japanese-cp932) | 107 | (define-coding-system-alias 'cp932 'japanese-cp932) |
| 84 | 108 | ||
| 85 | ;; Fixme: AKA Shift-JIS according to | ||
| 86 | ;; <URL:http://www.microsoft.com/globaldev/reference/WinCP.asp>. Is | ||
| 87 | ;; that correct? | ||
| 88 | |||
| 89 | (define-coding-system 'japanese-iso-7bit-1978-irv | 109 | (define-coding-system 'japanese-iso-7bit-1978-irv |
| 90 | "ISO 2022 based 7-bit encoding for Japanese JISX0208-1978 and JISX0201-Roman." | 110 | "ISO 2022 based 7-bit encoding for Japanese JISX0208-1978 and JISX0201-Roman." |
| 91 | :coding-type 'iso-2022 | 111 | :coding-type 'iso-2022 |
| @@ -116,6 +136,18 @@ | |||
| 116 | (define-coding-system-alias 'euc-japan 'japanese-iso-8bit) | 136 | (define-coding-system-alias 'euc-japan 'japanese-iso-8bit) |
| 117 | (define-coding-system-alias 'euc-jp 'japanese-iso-8bit) | 137 | (define-coding-system-alias 'euc-jp 'japanese-iso-8bit) |
| 118 | 138 | ||
| 139 | (define-coding-system 'eucjp-ms | ||
| 140 | "eucJP-ms (like EUC-JP but with CP932 extension). | ||
| 141 | eucJP-ms is defined in <http://www.opengroup.or.jp/jvc/cde/appendix.html>." | ||
| 142 | :coding-type 'iso-2022 | ||
| 143 | :mnemonic ?E | ||
| 144 | :designation [ascii japanese-jisx0208 katakana-jisx0201 japanese-jisx0212] | ||
| 145 | :flags '(short ascii-at-eol ascii-at-cntl single-shift) | ||
| 146 | :charset-list '(ascii latin-jisx0201 japanese-jisx0208 | ||
| 147 | katakana-jisx0201 japanese-jisx0212) | ||
| 148 | :decode-translation-table 'eucjp-ms-decode | ||
| 149 | :encode-translation-table 'eucjp-ms-encode) | ||
| 150 | |||
| 119 | (set-language-info-alist | 151 | (set-language-info-alist |
| 120 | "Japanese" '((setup-function . setup-japanese-environment-internal) | 152 | "Japanese" '((setup-function . setup-japanese-environment-internal) |
| 121 | (tutorial . "TUTORIAL.ja") | 153 | (tutorial . "TUTORIAL.ja") |