Mercurial > emacs
changeset 89760:292dab2b369e
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.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Tue, 27 Jan 2004 02:39:40 +0000 |
parents | d11866e9fbf4 |
children | dc955277692c |
files | lisp/language/japanese.el |
diffstat | 1 files changed, 36 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/language/japanese.el Tue Jan 27 02:21:37 2004 +0000 +++ b/lisp/language/japanese.el Tue Jan 27 02:39:40 2004 +0000 @@ -32,6 +32,10 @@ ;;; Code: +;;; Load translation tables for CP932. +(load "international/cp51932") +(load "international/eucjp-ms") + (define-coding-system 'iso-2022-jp "ISO 2022 based 7bit encoding for Japanese (MIME:ISO-2022-JP)." :coding-type 'iso-2022 @@ -64,6 +68,26 @@ latin-iso8859-1 greek-iso8859-7) :mime-charset 'iso-2022-jp-2) +(let ((map ; SJIS vs CP932 + '((#x301C . #xFF5E) ; WAVE DASH FULLWIDTH TILDE + (#x2016 . #x2225) ; DOUBLE VERTICAL LINE PARALLEL TO + (#x2212 . #xFF0D) ; MINUS SIGN FULLWIDTH HYPHEN-MINUS + (#x00A2 . #xFFE0) ; CENT SIGN FULLWIDTH CENT SIGN + (#x00A3 . #xFFE1) ; POUND SIGN FULLWIDTH POUND SIGN + (#x00AC . #xFFE2) ; NOT SIGN FULLWIDTH NOT SIGN + ))) + (define-translation-table 'japanese-ucs-cp932-map map) + (mapc #'(lambda (x) (let ((tmp (car x))) + (setcar x (cdr x)) (setcdr x tmp))) + map) + (define-translation-table 'japanese-ucs-jis-map map) + (define-translation-table 'japanese-ucs-glibc-map map)) + +;; U+2014 (EM DASH) vs U+2015 (HORIZONTAL BAR) +(aset (get 'japanese-ucs-cp932-map 'translation-table) #x2014 #x2015) +(aset (get 'japanese-ucs-jis-map 'translation-table) #x2015 #x2014) +(aset (get 'japanese-ucs-glibc-map 'translation-table) #x2014 #x2015) + (define-coding-system 'japanese-shift-jis "Shift-JIS 8-bit encoding for Japanese (MIME:SHIFT_JIS)" :coding-type 'shift-jis @@ -82,10 +106,6 @@ (define-coding-system-alias 'cp932 'japanese-cp932) -;; Fixme: AKA Shift-JIS according to -;; <URL:http://www.microsoft.com/globaldev/reference/WinCP.asp>. Is -;; that correct? - (define-coding-system 'japanese-iso-7bit-1978-irv "ISO 2022 based 7-bit encoding for Japanese JISX0208-1978 and JISX0201-Roman." :coding-type 'iso-2022 @@ -116,6 +136,18 @@ (define-coding-system-alias 'euc-japan 'japanese-iso-8bit) (define-coding-system-alias 'euc-jp 'japanese-iso-8bit) +(define-coding-system 'eucjp-ms + "eucJP-ms (like EUC-JP but with CP932 extension). +eucJP-ms is defined in <http://www.opengroup.or.jp/jvc/cde/appendix.html>." + :coding-type 'iso-2022 + :mnemonic ?E + :designation [ascii japanese-jisx0208 katakana-jisx0201 japanese-jisx0212] + :flags '(short ascii-at-eol ascii-at-cntl single-shift) + :charset-list '(ascii latin-jisx0201 japanese-jisx0208 + katakana-jisx0201 japanese-jisx0212) + :decode-translation-table 'eucjp-ms-decode + :encode-translation-table 'eucjp-ms-encode) + (set-language-info-alist "Japanese" '((setup-function . setup-japanese-environment-internal) (tutorial . "TUTORIAL.ja")