annotate lisp/mule/japanese.el @ 3569:6486a15d7e3e

[xemacs-hg @ 2006-08-23 19:57:49 by aidan] Change the Guillemet syntax, again, this time to punctuation.
author aidan
date Wed, 23 Aug 2006 19:57:50 +0000
parents 402bf23dd28f
children 98af8a976fc3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 ;;; japanese.el --- Japanese support -*- coding: iso-2022-7bit; -*-
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 ;; Licensed to the Free Software Foundation.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 ;; Copyright (C) 1997 MORIOKA Tomohiko
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
6 ;; Copyright (C) 2000, 2002 Ben Wing.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 ;; Keywords: multilingual, Japanese
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 ;; This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 ;; XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 ;; under the terms of the GNU General Public License as published by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 ;; any later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 ;; XEmacs is distributed in the hope that it will be useful, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 ;; General Public License for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 ;; along with XEmacs; see the file COPYING. If not, write to the Free
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 ;; 02111-1307, USA.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
27 ;;; Synched up with: Emacs 20.6 (international/japanese.el).
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
28
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 ;;; Commentary:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 ;; For Japanese, character sets JISX0201, JISX0208, JISX0212 are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 ;; supported.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 ;;; Code:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35
778
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
36 ; (make-charset 'katakana-jisx0201
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
37 ; "Katakana Part of JISX0201.1976"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
38 ; '(dimension
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
39 ; 1
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
40 ; registry "JISX0201"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
41 ; chars 94
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
42 ; columns 1
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
43 ; direction l2r
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
44 ; final ?I
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
45 ; graphic 1
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
46 ; short-name "JISX0201 Katakana"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
47 ; long-name "Japanese Katakana (JISX0201.1976)"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
48 ; ))
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
49
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
50 ; (make-charset 'latin-jisx0201
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
51 ; "Roman Part of JISX0201.1976"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
52 ; '(dimension
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
53 ; 1
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
54 ; registry "JISX0201"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
55 ; chars 94
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
56 ; columns 1
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
57 ; direction l2r
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
58 ; final ?J
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
59 ; graphic 0
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
60 ; short-name "JISX0201 Roman"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
61 ; long-name "Japanese Roman (JISX0201.1976)"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
62 ; ))
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
63
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
64 ; (make-charset 'japanese-jisx0208-1978
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
65 ; "JISX0208.1978 Japanese Kanji (so called \"old JIS\"): ISO-IR-42"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
66 ; '(dimension
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
67 ; 2
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
68 ; registry "JISX0208.1990"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
69 ; registry "JISX0208.1978"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
70 ; chars 94
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
71 ; columns 2
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
72 ; direction l2r
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
73 ; final ?@
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
74 ; graphic 0
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
75 ; short-name "JISX0208.1978"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
76 ; long-name "JISX0208.1978 (Japanese): ISO-IR-42"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
77 ; ))
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
78
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
79 ; (make-charset 'japanese-jisx0208
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
80 ; "JISX0208.1983/1990 Japanese Kanji: ISO-IR-87"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
81 ; '(dimension
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
82 ; 2
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
83 ; chars 94
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
84 ; columns 2
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
85 ; direction l2r
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
86 ; final ?B
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
87 ; graphic 0
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
88 ; short-name "JISX0208"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
89 ; long-name "JISX0208.1983/1990 (Japanese): ISO-IR-87"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
90 ; ))
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
91
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
92 ; (make-charset 'japanese-jisx0212
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
93 ; "JISX0212 Japanese supplement: ISO-IR-159"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
94 ; '(dimension
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
95 ; 2
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
96 ; registry "JISX0212"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
97 ; chars 94
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
98 ; columns 2
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
99 ; direction l2r
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
100 ; final ?D
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
101 ; graphic 0
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
102 ; short-name "JISX0212"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
103 ; long-name "JISX0212 (Japanese): ISO-IR-159"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
104 ; ))
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
105
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
106 (make-charset 'japanese-jisx0213-1 "JISX0213 Plane 1 (Japanese)"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
107 '(dimension
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
108 2
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
109 registry "JISX0213.2000-1"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
110 chars 94
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
111 columns 2
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
112 direction l2r
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
113 final ?O
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
114 graphic 0
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
115 short-name "JISX0213-1"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
116 long-name "JISX0213-1"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
117 ))
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
118
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
119 ;; JISX0213 Plane 2
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
120 (make-charset 'japanese-jisx0213-2 "JISX0213 Plane 2 (Japanese)"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
121 '(dimension
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
122 2
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
123 registry "JISX0213.2000-2"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
124 chars 94
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
125 columns 2
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
126 direction l2r
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
127 final ?P
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
128 graphic 0
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
129 short-name "JISX0213-2"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
130 long-name "JISX0213-2"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
131 ))
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
132
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 ;;; Syntax of Japanese characters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 (modify-syntax-entry 'katakana-jisx0201 "w")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 (modify-syntax-entry 'japanese-jisx0212 "w")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 (modify-syntax-entry 'japanese-jisx0208 "w")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 (loop for row in '(33 34 40)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 do (modify-syntax-entry `[japanese-jisx0208 ,row] "_"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 (loop for char in '(?$B!<(B ?$B!+(B ?$B!,(B ?$B!3(B ?$B!4(B ?$B!5(B ?$B!6(B ?$B!7(B ?$B!8(B ?$B!9(B ?$B!:(B ?$B!;(B)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 do (modify-syntax-entry char "w"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 (modify-syntax-entry ?\$B!J(B "($B!K(B")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 (modify-syntax-entry ?\$B!N(B "($B!O(B")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144 (modify-syntax-entry ?\$B!P(B "($B!Q(B")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 (modify-syntax-entry ?\$B!V(B "($B!W(B")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146 (modify-syntax-entry ?\$B!X(B "($B!Y(B")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 (modify-syntax-entry ?\$B!K(B ")$B!J(B")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148 (modify-syntax-entry ?\$B!O(B ")$B!N(B")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 (modify-syntax-entry ?\$B!Q(B ")$B!P(B")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 (modify-syntax-entry ?\$B!W(B ")$B!V(B")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 (modify-syntax-entry ?\$B!Y(B ")$B!X(B")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
152
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153 ;;; Character categories S, A, H, K, G, Y, and C
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 (define-category ?S "Japanese 2-byte symbol character.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155 (modify-category-entry [japanese-jisx0208 33] ?S)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156 (modify-category-entry [japanese-jisx0208 34] ?S)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157 (modify-category-entry [japanese-jisx0208 40] ?S)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 (define-category ?A "Japanese 2-byte Alphanumeric character.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 (modify-category-entry [japanese-jisx0208 35] ?A)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160 (define-category ?H "Japanese 2-byte Hiragana character.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 (modify-category-entry [japanese-jisx0208 36] ?H)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 (define-category ?K "Japanese 2-byte Katakana character.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 (modify-category-entry [japanese-jisx0208 37] ?K)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 (define-category ?G "Japanese 2-byte Greek character.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165 (modify-category-entry [japanese-jisx0208 38] ?G)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 (define-category ?Y "Japanese 2-byte Cyrillic character.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 (modify-category-entry [japanese-jisx0208 39] ?Y)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 (define-category ?C "Japanese 2-byte Kanji characters.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169 (loop for row from 48 to 126
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 do (modify-category-entry `[japanese-jisx0208 ,row] ?C))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 (loop for char in '(?$B!<(B ?$B!+(B ?$B!,(B)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172 do (modify-category-entry char ?K)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 (modify-category-entry char ?H))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 (loop for char in '(?$B!3(B ?$B!4(B ?$B!5(B ?$B!6(B ?$B!7(B ?$B!8(B ?$B!9(B ?$B!:(B ?$B!;(B)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 do (modify-category-entry char ?C))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 (modify-category-entry 'japanese-jisx0212 ?C)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 (defvar japanese-word-regexp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 "\\cA+\\cH*\\|\\cK+\\cH*\\|\\cC+\\cH*\\|\\cH+\\|\\ck+\\|\\sw+"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180 "Regular expression used to match a Japanese word.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 (set-word-regexp japanese-word-regexp)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 (setq forward-word-regexp "\\w\\>")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 (setq backward-word-regexp "\\<\\w")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186 ;;; Paragraph setting
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 (setq sentence-end
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 (concat
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 "\\("
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 "\\("
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 "[.?!][]\"')}]*"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 "\\|"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 "[$B!%!)!*(B][$B!O!I!G!K!Q!M!S!U!W!Y(B]*"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 "\\)"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 "\\($\\|\t\\| \\)"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 "\\|"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 "$B!#(B"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 "\\)"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 "[ \t\n]*"))
1891
402bf23dd28f [xemacs-hg @ 2004-01-29 05:22:37 by stephent]
stephent
parents: 810
diff changeset
200
402bf23dd28f [xemacs-hg @ 2004-01-29 05:22:37 by stephent]
stephent
parents: 810
diff changeset
201 ;; allow paragraphs to start with a zenkaku space
402bf23dd28f [xemacs-hg @ 2004-01-29 05:22:37 by stephent]
stephent
parents: 810
diff changeset
202 (setq paragraph-start "[ $B!!(B\t\n\f]")
402bf23dd28f [xemacs-hg @ 2004-01-29 05:22:37 by stephent]
stephent
parents: 810
diff changeset
203 (setq paragraph-separate "[ $B!!(B\t\f]*$")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 ;; EGG specific setup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206 (define-egg-environment 'japanese
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 "Japanese settings for egg."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 (lambda ()
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
209 (with-boundp '(its:*standard-modes* its:*current-map* wnn-server-type)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
210 (with-fboundp 'its:get-mode-map
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
211 (when (not (featurep 'egg-jpn))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
212 (load "its-hira")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
213 (load "its-kata")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
214 (load "its-hankaku")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
215 (load "its-zenkaku")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
216 (setq its:*standard-modes*
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
217 (append
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
218 (list (its:get-mode-map "roma-kana")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
219 (its:get-mode-map "roma-kata")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
220 (its:get-mode-map "downcase")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
221 (its:get-mode-map "upcase")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
222 (its:get-mode-map "zenkaku-downcase")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
223 (its:get-mode-map "zenkaku-upcase"))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
224 its:*standard-modes*))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
225 (provide 'egg-jpn))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
226 (setq wnn-server-type 'jserver)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
227 ;; Can't do this here any more. Must do it when selecting egg-wnn
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
228 ;; or egg-sj3
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
229 ;; (setq egg-default-startup-file "eggrc-wnn")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
230 (setq-default its:*current-map* (its:get-mode-map "roma-kana"))))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231
450
98528da0b7fc Import from CVS: tag r21-2-40
cvs
parents: 428
diff changeset
232 ;; stuff for providing grammatic processing of Japanese text
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 ;; something like this should probably be created for all environments...
450
98528da0b7fc Import from CVS: tag r21-2-40
cvs
parents: 428
diff changeset
234 ;; #### Arrgh. This stuff should defvar'd in either fill.el or kinsoku.el.
98528da0b7fc Import from CVS: tag r21-2-40
cvs
parents: 428
diff changeset
235 ;; Then the language environment should set these things, probably buffer-
98528da0b7fc Import from CVS: tag r21-2-40
cvs
parents: 428
diff changeset
236 ;; locally.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
238 ;; #### will be moved to fill.el
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
239 (defvar space-insertable
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
240 (let* ((aletter (concat "\\(" ascii-char "\\|" kanji-char "\\)"))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
241 (kanji-space-insertable
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
242 (concat
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 "$B!"(B" aletter "\\|"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 "$B!#(B" aletter "\\|"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 aletter "$B!J(B" "\\|"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 "$B!K(B" aletter "\\|"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 ascii-alphanumeric kanji-kanji-char "\\|"
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
248 kanji-kanji-char ascii-alphanumeric)))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
249 (concat " " aletter "\\|" kanji-space-insertable))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
250 "Regexp for finding points that can have spaces inserted into them for justification")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
252 ;; Beginning of FSF synching with international/japanese.el.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
253
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 ;; (make-coding-system
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 ;; 'iso-2022-jp 2 ?J
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 ;; "ISO 2022 based 7bit encoding for Japanese (MIME:ISO-2022-JP)"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 ;; '((ascii japanese-jisx0208-1978 japanese-jisx0208
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 ;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201) nil nil nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 ;; short ascii-eol ascii-cntl seven)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260 ;; '((safe-charsets ascii japanese-jisx0208-1978 japanese-jisx0208
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 ;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 ;; (mime-charset . iso-2022-jp)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 (make-coding-system
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265 'iso-2022-jp 'iso2022
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
266 "ISO-2022-JP (Japanese mail)"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 '(charset-g0 ascii
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268 short t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269 seven t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270 input-charset-conversion ((latin-jisx0201 ascii)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271 (japanese-jisx0208-1978 japanese-jisx0208))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272 mnemonic "MULE/7bit"
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
273 documentation
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
274 "Coding system used for communication with mail and news in Japan."
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
275 ))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
276
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
277 (make-coding-system
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
278 'jis7 'iso2022
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
279 "JIS7 (old Japanese 7-bit encoding)"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
280 '(charset-g0 ascii
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
281 charset-g1 katakana-jisx0201
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
282 short t
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
283 seven t
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
284 lock-shift t
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
285 input-charset-conversion ((latin-jisx0201 ascii)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
286 (japanese-jisx0208-1978 japanese-jisx0208))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
287 mnemonic "JIS7"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
288 documentation
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
289 "Old JIS 7-bit encoding; mostly superseded by ISO-2022-JP.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
290 Uses locking-shift (SI/SO) to select half-width katakana."
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
291 ))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
292
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
293 (make-coding-system
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
294 'jis8 'iso2022
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
295 "JIS8 (old Japanese 8-bit encoding)"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
296 '(charset-g0 ascii
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
297 charset-g1 katakana-jisx0201
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
298 short t
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
299 input-charset-conversion ((latin-jisx0201 ascii)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
300 (japanese-jisx0208-1978 japanese-jisx0208))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
301 mnemonic "JIS8"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
302 documentation
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
303 "Old JIS 8-bit encoding; mostly superseded by ISO-2022-JP.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
304 Uses high bytes for half-width katakana."
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 ))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307 (define-coding-system-alias 'junet 'iso-2022-jp)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309 ;; (make-coding-system
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310 ;; 'iso-2022-jp-2 2 ?J
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 ;; "ISO 2022 based 7bit encoding for CJK, Latin-1, and Greek (MIME:ISO-2022-JP-2)"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 ;; '((ascii japanese-jisx0208-1978 japanese-jisx0208
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 ;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 ;; chinese-gb2312 korean-ksc5601) nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315 ;; (nil latin-iso8859-1 greek-iso8859-7) nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316 ;; short ascii-eol ascii-cntl seven nil single-shift)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317 ;; '((safe-charsets ascii japanese-jisx0208-1978 japanese-jisx0208
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318 ;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319 ;; chinese-gb2312 korean-ksc5601
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320 ;; latin-iso8859-1 greek-iso8859-7)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321 ;; (mime-charset . iso-2022-jp-2)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323 ;; (make-coding-system
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
324 ;; 'japanese-shift-jis 1 ?S
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325 ;; "Shift-JIS 8-bit encoding for Japanese (MIME:SHIFT_JIS)"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 ;; nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327 ;; '((safe-charsets ascii japanese-jisx0208 japanese-jisx0208-1978
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328 ;; latin-jisx0201 katakana-jisx0201)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
329 ;; (mime-charset . shift-jis)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330 ;; (charset-origin-alist (japanese-jisx0208 "SJIS" encode-sjis-char)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
331 ;; (katakana-jisx0201 "SJIS" encode-sjis-char))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
332
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
333 (make-coding-system
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
334 'shift-jis 'shift-jis
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
335 "Shift-JIS"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
336 '(mnemonic "Ja/SJIS"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
337 documentation "The standard Japanese encoding in MS Windows."
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
338 ))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
340 ;; A former name?
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
341 (define-coding-system-alias 'shift_jis 'shift-jis)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
342
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
343 ;; FSF:
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
344 ;; (define-coding-system-alias 'shift-jis 'japanese-shift-jis)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
345 ;; (define-coding-system-alias 'sjis 'japanese-shift-jis)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
346
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347 ;; (make-coding-system
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348 ;; 'japanese-iso-7bit-1978-irv 2 ?j
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349 ;; "ISO 2022 based 7-bit encoding for Japanese JISX0208-1978 and JISX0201-Roman"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
350 ;; '((ascii japanese-jisx0208-1978 japanese-jisx0208
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
351 ;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201 t) nil nil nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
352 ;; short ascii-eol ascii-cntl seven nil nil use-roman use-oldjis)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
353 ;; '(ascii japanese-jisx0208-1978 japanese-jisx0208 latin-jisx0201))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
354
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355 (make-coding-system
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356 'iso-2022-jp-1978-irv 'iso2022
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
357 "ISO-2022-JP-1978-IRV (Old JIS)"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
358 '(charset-g0 ascii
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359 short t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360 seven t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361 output-charset-conversion ((ascii latin-jisx0201)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
362 (japanese-jisx0208 japanese-jisx0208-1978))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
363 documentation
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
364 "This is a coding system used for old JIS terminals. It's an ISO
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
365 2022 based 7-bit encoding for Japanese JISX0208-1978 and JISX0201-Roman."
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366 mnemonic "Ja-78/7bit"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 ))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
368
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
369 ;; FSF:
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
370 ;; (define-coding-system-alias 'iso-2022-jp-1978-irv 'japanese-iso-7bit-1978-irv)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
371 ;; (define-coding-system-alias 'old-jis 'japanese-iso-7bit-1978-irv)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373 (define-coding-system-alias 'old-jis 'iso-2022-jp-1978-irv)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375 ;; (make-coding-system
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376 ;; 'japanese-iso-8bit 2 ?E
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377 ;; "ISO 2022 based EUC encoding for Japanese (MIME:EUC-JP)"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378 ;; '(ascii japanese-jisx0208 katakana-jisx0201 japanese-jisx0212
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379 ;; short ascii-eol ascii-cntl nil nil single-shift)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 ;; '((safe-charsets ascii latin-jisx0201 japanese-jisx0208 japanese-jisx0208-1978
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
381 ;; katakana-jisx0201 japanese-jisx0212)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
382 ;; (mime-charset . euc-jp)))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
383 ;;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
384 (make-coding-system
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
385 'euc-jp 'iso2022
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
386 "Japanese EUC"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
387 '(charset-g0 ascii
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
388 charset-g1 japanese-jisx0208
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
389 charset-g2 katakana-jisx0201
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
390 charset-g3 japanese-jisx0212
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
391 short t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
392 mnemonic "Ja/EUC"
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
393 documentation
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
394 "Japanese EUC (Extended Unix Code), the standard Japanese encoding in Unix.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
395 Equivalent MIME encoding: EUC-JP.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
396
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
397 Japanese EUC was the forefather of all the different EUC's, which all follow
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
398 a similar structure:
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
399
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
400 1. Up to four character sets can be encoded.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
401
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
402 2. This is a non-modal encoding, i.e. it is impossible to set a global state
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
403 that affects anything more than the directly following character. [Modal
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
404 encodings typically have escape sequences to change global settings, which
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
405 affect all the following characters until the setting is turned off.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
406 Modal encodings are typically used when it's necessary to support text in
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
407 a wide variety of character sets and still keep basic ASCII compatibility,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
408 or in cases (e.g. sending email) where the allowed characters that can
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
409 pass the gateway are small and (typically) no high-bit range is available.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
410
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
411 3. The first character set is always ASCII or some national variant of it,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
412 and encoded in the standard ASCII position. All characters in all other
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
413 character sets are encoded entirely using high-half bytes. Therefore,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
414 it is safe to scan for ASCII characters, such as '/' to separate path
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
415 components, in the obvious way.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
416
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
417 4. Each of the other three character sets can be of dimension 1, 2, or 3.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
418 A dimension-1 character set contains 96 bytes; a dimension-2 character
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
419 set contains 96 x 96 bytes; and a dimension-3 character set contains
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
420 96 x 96 x 96 bytes. 94 instead of 96 as the number of characters per
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
421 dimension is also supported. Character sets of dimensions 1, 2, and 3
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
422 use 1-3 bytes, respectively, to encode a character, and each byte is
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
423 in the range A0-FF (or A1-FE for those with 94 bytes per dimension).
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
424
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
425 5. The four character sets encoded in EUC are called G0, G1, G2, and G3.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
426 As mentioned earlier, G0 is ASCII or some variant, and encoded into
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
427 the ASCII positions 00 - 7F. G1 is encoded directly by laying out
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
428 its bytes. G2 is encoded using an 8E byte followed by the character's
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
429 bytes. G3 is encoded using an 8F byte followed by the character's bytes."
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
430
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
431 ))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
432
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
433 ;; FSF:
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
434 ;; (define-coding-system-alias 'euc-japan-1990 'japanese-iso-8bit)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
435 ;; (define-coding-system-alias 'euc-japan 'japanese-iso-8bit)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
436 ;; (define-coding-system-alias 'euc-jp 'japanese-iso-8bit)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
437
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
438 (define-coding-system-alias 'euc-japan 'euc-jp) ; only for w3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
439 (define-coding-system-alias 'japanese-euc 'euc-jp)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
440
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
441 (set-language-info-alist
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
442 "Japanese" '((setup-function . setup-japanese-environment-internal)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
443 (exit-function . exit-japanese-environment)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
444 (tutorial . "TUTORIAL.ja")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
445 (charset japanese-jisx0208 japanese-jisx0208-1978
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
446 japanese-jisx0212 latin-jisx0201 katakana-jisx0201)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
447 (coding-system iso-2022-jp euc-jp
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
448 shift-jis iso-2022-jp-2)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
449 (coding-priority iso-2022-jp euc-jp
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
450 shift-jis iso-2022-jp-2)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
451 ;; These locale names come from the X11R6 locale.alias file.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
452 ;; What an incredible fucking mess!!!!!!!!!!!!!!!!!!!!!!!!!!
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
453 ;; What's worse is that typical Unix implementations of
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
454 ;; setlocale() return back exactly what you passed them, even
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
455 ;; though it's perfectly allowed (and in fact done under
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
456 ;; Windows) to expand the locale to its full form (including
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
457 ;; encoding), so you have some hint as to the encoding!!!
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
458 ;;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
459 ;; We order them in such a way that we're maximally likely
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
460 ;; to get an encoding name.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
461 ;;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
462 (locale
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
463 ;; SunOS 5.7: ja ja_JP.PCK ja_JP.UTF-8 japanese
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
464 ;; RedHat Linux 6.2J: ja ja_JP ja_JP.eucJP ja_JP.ujis \
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
465 ;; japanese japanese.euc
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
466 ;; HP-UX 10.20: ja_JP.SJIS ja_JP.eucJPput ja_JP.kana8
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
467 ;; Cygwin b20.1: ja_JP.EUC
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
468 ;; FreeBSD 2.2.8: ja_JP.EUC ja_JP.SJIS
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
469
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
470 ;; EUC locales
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
471 "ja_JP.EUC"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
472 "ja_JP.eucJP"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
473 "ja_JP.AJEC"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
474 "ja_JP.ujis"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
475 "Japanese-EUC"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
476 "japanese.euc"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
477
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
478 ;; Shift-JIS locales
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
479 "ja_JP.SJIS"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
480 "ja_JP.mscode"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
481 "ja.SJIS"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
482
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
483 ;; 7-bit locales
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
484 "ja_JP.ISO-2022-JP"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
485 "ja_JP.jis7"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
486 "ja_JP.pjis"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
487 "ja_JP.JIS"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
488 "ja.JIS"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
489
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
490 ;; 8-bit locales
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
491 "ja_JP.jis8"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
492
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
493 ;; encoding-unspecified locales
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
494 "ja_JP"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
495 "Ja_JP"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
496 "Jp_JP"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
497 "japanese"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
498 "japan"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
499 "ja"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
500 )
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
501
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
502 (native-coding-system
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
503 ;; first, see if an explicit encoding was given.
810
0f42d0a17667 [xemacs-hg @ 2002-04-07 17:10:48 by daiki]
daiki
parents: 778
diff changeset
504 (lambda (locale)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
505 (let ((case-fold-search t))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
506 (cond
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
507 ;; many unix versions
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
508 ((string-match "\\.euc" locale) 'euc-jp)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
509 ((string-match "\\.sjis" locale) 'shift-jis)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
510
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
511 ;; X11R6 (CJKV p. 471)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
512 ((string-match "\\.jis7" locale) 'jis7)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
513 ((string-match "\\.jis8" locale) 'jis8)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
514 ((string-match "\\.mscode" locale) 'shift-jis)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
515 ((string-match "\\.pjis" locale) 'iso-2022-jp)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
516 ((string-match "\\.ujis" locale) 'euc-jp)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
517
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
518 ;; other names in X11R6 locale.alias
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
519 ((string-match "\\.ajec" locale) 'euc-jp)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
520 ((string-match "-euc" locale) 'euc-jp)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
521 ((string-match "\\.iso-2022-jp" locale) 'iso-2022-jp)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
522 ((string-match "\\.jis" locale) 'jis7) ;; or just jis?
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
523 )))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
524
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
525 ;; aix (CJKV p. 465)
810
0f42d0a17667 [xemacs-hg @ 2002-04-07 17:10:48 by daiki]
daiki
parents: 778
diff changeset
526 (lambda (locale)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
527 (when (eq system-type 'aix)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
528 (cond
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
529 ((string-match "^Ja_JP" locale) 'shift-jis)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
530 ((string-match "^ja_JP" locale) 'euc-jp))))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
531
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
532 ;; other X11R6 locale.alias
810
0f42d0a17667 [xemacs-hg @ 2002-04-07 17:10:48 by daiki]
daiki
parents: 778
diff changeset
533 (lambda (locale)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
534 (cond
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
535 ((string-match "^Jp_JP" locale) 'euc-jp)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
536 ((and (eq system-type 'hpux) (eq locale "japanese"))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
537 'shift-jis)))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
538
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
539 ;; fallback
810
0f42d0a17667 [xemacs-hg @ 2002-04-07 17:10:48 by daiki]
daiki
parents: 778
diff changeset
540 euc-jp)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
541
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
542 ;; (input-method . "japanese")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
543 (features japan-util)
450
98528da0b7fc Import from CVS: tag r21-2-40
cvs
parents: 428
diff changeset
544 (sample-text . "Japanese ($BF|K\8l(B) $B$3$s$K$A$O(B, (I:]FAJ(B")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
545 (documentation . t)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
546
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
547 ;;; japanese.el ends here