]> code.delx.au - gnu-emacs/blob - lisp/language/european.el
(mac-roman-decoder, mac-roman-encoder): New translation tables.
[gnu-emacs] / lisp / language / european.el
1 ;;; european.el --- European languages -*- coding: iso-2022-7bit; -*-
2
3 ;; Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN.
4 ;; Licensed to the Free Software Foundation.
5
6 ;; Keywords: multilingual, European
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 Europeans, character sets ISO8859-1,2,3,4,9,14,15 are supported.
28
29 ;;; Code:
30
31 ;; Latin-1 (ISO-8859-1)
32
33 (make-coding-system
34 'iso-latin-1 2 ?1
35 "ISO 2022 based 8-bit encoding for Latin-1 (MIME:ISO-8859-1)"
36 '(ascii latin-iso8859-1 nil nil
37 nil nil nil nil nil nil nil nil nil nil nil nil t)
38 '((safe-charsets ascii latin-iso8859-1)
39 (mime-charset . iso-8859-1)))
40
41 (define-coding-system-alias 'iso-8859-1 'iso-latin-1)
42 (define-coding-system-alias 'latin-1 'iso-latin-1)
43
44 (make-coding-system
45 'compound-text 2 ?1
46 "ISO 2022 based encoding used in inter client communication of X"
47 '((ascii t) (latin-iso8859-1 katakana-jisx0201 t) nil nil
48 nil ascii-eol ascii-cntl nil nil nil nil nil nil nil nil nil t)
49 '((safe-charsets . t)))
50
51 (define-coding-system-alias 'ctext 'compound-text)
52
53 (set-language-info-alist
54 "Latin-1" '((charset ascii latin-iso8859-1)
55 (coding-system iso-latin-1)
56 (coding-priority iso-latin-1)
57 (nonascii-translation . latin-iso8859-1)
58 (unibyte-syntax . "latin-1")
59 (unibyte-display . iso-latin-1)
60 (input-method . "latin-1-prefix")
61 (sample-text
62 . "Hello, Hej, Tere, Hei, Bonjour, Gr\e,A|_\e(B Gott, Ciao, \e,A!\e(BHola!")
63 (documentation . "\
64 This language environment is a generic one for the Latin-1 (ISO-8859-1)
65 character set which supports the following European languages:
66 Albanian, Basque, Breton, Catalan, Danish, Dutch, English, Faeroese,
67 Finnish, French (with restrictions -- see Latin-9), Frisian, Galician,
68 German, Greenlandic, Icelandic, Irish Gaelic (new orthography),
69 Italian, Latin, Luxemburgish, Norwegian, Portuguese, Rhaeto-Romanic,
70 Scottish Gaelic, Spanish, and Swedish.
71 We also have a German specific language environment \"German\".
72
73 Latin-1 also covers several written languages outside Europe, including
74 Indonesian/Malay, Tagalog (Philippines), Swahili and Afrikaans."))
75 '("European"))
76
77 \f
78 ;; Latin-2 (ISO-8859-2)
79
80 (make-coding-system
81 'iso-latin-2 2 ?2
82 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-2)"
83 '(ascii latin-iso8859-2 nil nil
84 nil nil nil nil nil nil nil)
85 '((safe-charsets ascii latin-iso8859-2)
86 (mime-charset . iso-8859-2)))
87
88 (define-coding-system-alias 'iso-8859-2 'iso-latin-2)
89 (define-coding-system-alias 'latin-2 'iso-latin-2)
90
91 (set-language-info-alist
92 "Latin-2" '((charset ascii latin-iso8859-2)
93 (coding-system iso-latin-2)
94 (coding-priority iso-latin-2)
95 (nonascii-translation . latin-iso8859-2)
96 (unibyte-syntax . "latin-2")
97 (unibyte-display . iso-latin-2)
98 (input-method . "latin-2-prefix")
99 (documentation . "\
100 This language environment is a generic one for the Latin-2 (ISO-8859-2)
101 character set which supports the following languages:
102 Albanian, Czech, English, German, Hungarian, Polish, Romanian,
103 Serbo-Croatian or Croatian, Slovak, Slovene, Sorbian (upper and lower),
104 and Swedish.
105 We also have specific language environments for the following languages:
106 For Czech, \"Czech\".
107 For Romanian, \"Romanian\".
108 For Slovak, \"Slovak\"."))
109 '("European"))
110
111 \f
112 ;; Latin-3 (ISO-8859-3)
113
114 (make-coding-system
115 'iso-latin-3 2 ?3
116 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-3)"
117 '(ascii latin-iso8859-3 nil nil
118 nil nil nil nil nil nil nil)
119 '((safe-charsets ascii latin-iso8859-3)
120 (mime-charset . iso-8859-3)))
121
122 (define-coding-system-alias 'iso-8859-3 'iso-latin-3)
123 (define-coding-system-alias 'latin-3 'iso-latin-3)
124
125 (set-language-info-alist
126 "Latin-3" '((charset ascii latin-iso8859-3)
127 (coding-system iso-latin-3)
128 (coding-priority iso-latin-3)
129 (nonascii-translation . latin-iso8859-3)
130 (unibyte-syntax . "latin-3")
131 (unibyte-display . iso-latin-3)
132 (input-method . "latin-3-prefix")
133 (documentation . "\
134 These languages are supported with the Latin-3 (ISO-8859-3) character set:
135 Afrikaans, Catalan, Dutch, English, Esperanto, French, Galician,
136 German, Italian, Maltese, Spanish, and Turkish."))
137 '("European"))
138
139 \f
140 ;; Latin-4 (ISO-8859-4)
141
142 (make-coding-system
143 'iso-latin-4 2 ?4
144 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-4)"
145 '(ascii latin-iso8859-4 nil nil
146 nil nil nil nil nil nil nil)
147 '((safe-charsets ascii latin-iso8859-4)
148 (mime-charset . iso-8859-4)))
149
150 (define-coding-system-alias 'iso-8859-4 'iso-latin-4)
151 (define-coding-system-alias 'latin-4 'iso-latin-4)
152
153 (set-language-info-alist
154 "Latin-4" '((charset ascii latin-iso8859-4)
155 (coding-system iso-8859-4)
156 (coding-priority iso-8859-4)
157 (nonascii-translation . latin-iso8859-4)
158 (unibyte-syntax . "latin-4")
159 (unibyte-display . iso-8859-4)
160 (input-method . "latin-4-prefix")
161 (documentation . "\
162 These languages are supported with the Latin-4 (ISO-8859-4) character set:
163 Danish, English, Estonian, Finnish, German, Greenlandic, Lappish,
164 Latvian, Lithuanian, and Norwegian."))
165 '("European"))
166
167 \f
168 ;; Latin-5 (ISO-8859-9)
169
170 (make-coding-system
171 'iso-latin-5 2 ?9
172 "ISO 2022 based 8-bit encoding (MIME:ISO-8859-9)"
173 '(ascii latin-iso8859-9 nil nil
174 nil nil nil nil nil nil nil)
175 '((safe-charsets ascii latin-iso8859-9)
176 (mime-charset . iso-8859-9)))
177
178 (define-coding-system-alias 'iso-8859-9 'iso-latin-5)
179 (define-coding-system-alias 'latin-5 'iso-latin-5)
180
181 (set-language-info-alist
182 "Latin-5" '((charset ascii latin-iso8859-9)
183 (coding-system iso-latin-5)
184 (coding-priority iso-latin-5)
185 (nonascii-translation . latin-iso8859-9)
186 (unibyte-syntax . "latin-5")
187 (unibyte-display . iso-latin-5)
188 (input-method . "latin-5-prefix")
189 (documentation . "\
190 These languages are supported with the Latin-5 (ISO-8859-9) character set:
191 Bulgarian, Byelorussian, (Slavic) Macedonian, Russian, Serbian and
192 Ukranian.")) ; says ISO 8859-1
193 '("European"))
194
195 \f
196 ;; Latin-8 (ISO-8859-14)
197
198 (make-coding-system
199 'iso-latin-8 2 ?W ; `W' for `Welsh', since `C'
200 ; for `Celtic' is taken.
201 "ISO 2022 based 8-bit encoding for Latin-8 (MIME:ISO-8859-14)"
202 '(ascii latin-iso8859-14 nil nil
203 nil nil nil nil nil nil nil nil nil nil nil nil t)
204 '((safe-charsets ascii latin-iso8859-14)
205 (mime-charset . iso-8859-14)))
206
207 (define-coding-system-alias 'iso-8859-14 'iso-latin-8)
208 (define-coding-system-alias 'latin-8 'iso-latin-8)
209
210 (set-language-info-alist
211 "Latin-8" '((charset ascii latin-iso8859-14)
212 (coding-system iso-latin-8)
213 (coding-priority iso-latin-8)
214 (nonascii-translation . latin-iso8859-14)
215 (unibyte-syntax . "latin-8")
216 (unibyte-display . iso-latin-8)
217 (input-method . "latin-8-prefix")
218 ;; Fixme: Welsh/Ga{e}lic greetings
219 (sample-text . "\e,_"\e(B \e,_p\e(B \e,_^\e(B")
220 (documentation . "\
221 This language environment is a generic one for the Latin-8 (ISO-8859-14)
222 character set which supports the Celtic languages, including those not
223 covered by other ISO-8859 character sets: Welsh, Manx Gaelic and
224 Irish Gaelic (old orthography)."))
225 '("European"))
226 \f
227 ;; Latin-9 (ISO-8859-15)
228
229 (make-coding-system
230 'iso-latin-9 2 ?0 ; `0' for `Latin-0'
231 "ISO 2022 based 8-bit encoding for Latin-9 (MIME:ISO-8859-15)"
232 '(ascii latin-iso8859-15 nil nil
233 nil nil nil nil nil nil nil nil nil nil nil nil t)
234 '((safe-charsets ascii latin-iso8859-15)
235 (mime-charset . iso-8859-15)))
236
237 (define-coding-system-alias 'iso-8859-15 'iso-latin-9)
238 (define-coding-system-alias 'latin-9 'iso-latin-9)
239 (define-coding-system-alias 'latin-0 'iso-latin-9)
240
241 (set-language-info-alist
242 "Latin-9" '((charset ascii latin-iso8859-15)
243 (coding-system iso-latin-9)
244 (coding-priority iso-latin-9)
245 (nonascii-translation . latin-iso8859-15)
246 (unibyte-syntax . "latin-9")
247 (unibyte-display . iso-latin-9)
248 (input-method . "latin-9-prefix")
249 (sample-text
250 . "AVE. \e,b&(48<=>\e(B \e,b$\e(B")
251 (documentation . "\
252 This language environment is a generic one for the Latin-9 (ISO-8859-15)
253 character set which supports the same languages as Latin-1 with the
254 addition of the Euro sign and some additional French and Finnish letters.
255 Latin-9 is sometimes nicknamed `Latin-0'."))
256 '("European"))
257 \f
258 (set-language-info-alist
259 "German" '((tutorial . "TUTORIAL.de")
260 (charset ascii latin-iso8859-1)
261 (coding-system iso-latin-1)
262 (coding-priority iso-latin-1)
263 (input-method . "german-postfix")
264 (nonascii-translation . iso-latin-1)
265 (unibyte-syntax . "latin-1")
266 (unibyte-display . iso-latin-1)
267 (sample-text . "\
268 German (Deutsch Nord) Guten Tag
269 German (Deutsch S\e,A|\e(Bd) Gr\e,A|_\e(B Gott")
270 (documentation . "\
271 This language environment is almost the same as Latin-1,
272 but default input method is set to \"german-postfix\"."))
273 '("European"))
274
275 (set-language-info-alist
276 "Slovenian" '((charset . (ascii latin-iso8859-2))
277 (coding-system . (iso-8859-2))
278 (coding-priority . (iso-8859-2))
279 (nonascii-translation . latin-iso8859-2)
280 (input-method . "latin-2-postfix")
281 (unibyte-syntax . "latin-2")
282 (unibyte-display . iso-8859-2)
283 (tutorial . "TUTORIAL.sl")
284 (sample-text . "\e,B.\e(Belimo vam uspe\e,B9\e(Ben dan!")
285 (documentation . t))
286 '("European"))
287
288 ;; For Turkish, the character set ISO-8859-9 (Latin-5) is used. But,
289 ;; before the introduction of ISO-8859-9 in 1988, ISO-8859-3 (Latin-3)
290 ;; was used for Turkish. Those who use Latin-3 for Turkish should use
291 ;; "Latin-3" language environment.
292
293 (set-language-info-alist
294 "Turkish" '((charset ascii latin-iso8859-9)
295 (coding-system iso-latin-5)
296 (coding-priority iso-latin-5)
297 (nonascii-translation . latin-iso8859-9)
298 (unibyte-syntax . "latin-5")
299 (unibyte-display . iso-latin-5)
300 (input-method . "turkish-postfix")
301 (sample-text . "Turkish (T\e,M|\e(Brk\e,Mg\e(Be) Merhaba")
302 (documentation . t)))
303
304 ;; Polish ISO 8859-2 environment.
305 ;; Maintainer: Wlodek Bzyl <matwb@univ.gda.pl>
306 ;; Keywords: multilingual, Polish
307
308 (set-language-info-alist
309 "Polish" '((charset . (ascii latin-iso8859-2))
310 (coding-system . (iso-8859-2))
311 (coding-priority . (iso-8859-2))
312 (input-method . "polish-slash")
313 (nonascii-translation . latin-iso8859-2)
314 (unibyte-syntax . "latin-2")
315 (unibyte-display . iso-8859-2)
316 (tutorial . "TUTORIAL.pl")
317 (sample-text . "\e,B1!fFjJ3#qQsS6&?/<,\e(B")
318 (documentation . t))
319 '("European"))
320
321 \f
322 ;; Definitions for the Mac Roman character sets and coding system.
323 ;; The Mac Roman encoding uses all 128 code points in the range 128 to
324 ;; 255 for actual characters. Emacs decode them to one of the
325 ;; following character sets.
326 ;; ascii, latin-iso8859-1, mule-unicode-0100-24ff,
327 ;; mule-unicode-2500-33ff, mule-unicode-e000-ffff
328
329 (let
330 ((encoding-vector (make-vector 256 nil))
331 (i 0)
332 (vec ;; mac-roman (128..255) -> UCS mapping
333 [ #x00C4 ;; 128:LATIN CAPITAL LETTER A WITH DIAERESIS
334 #x00C5 ;; 129:LATIN CAPITAL LETTER A WITH RING ABOVE
335 #x00C7 ;; 130:LATIN CAPITAL LETTER C WITH CEDILLA
336 #x00C9 ;; 131:LATIN CAPITAL LETTER E WITH ACUTE
337 #x00D1 ;; 132:LATIN CAPITAL LETTER N WITH TILDE
338 #x00D6 ;; 133:LATIN CAPITAL LETTER O WITH DIAERESIS
339 #x00DC ;; 134:LATIN CAPITAL LETTER U WITH DIAERESIS
340 #x00E1 ;; 135:LATIN SMALL LETTER A WITH ACUTE
341 #x00E0 ;; 136:LATIN SMALL LETTER A WITH GRAVE
342 #x00E2 ;; 137:LATIN SMALL LETTER A WITH CIRCUMFLEX
343 #x00E4 ;; 138:LATIN SMALL LETTER A WITH DIAERESIS
344 #x00E3 ;; 139:LATIN SMALL LETTER A WITH TILDE
345 #x00E5 ;; 140:LATIN SMALL LETTER A WITH RING ABOVE
346 #x00E7 ;; 141:LATIN SMALL LETTER C WITH CEDILLA
347 #x00E9 ;; 142:LATIN SMALL LETTER E WITH ACUTE
348 #x00E8 ;; 143:LATIN SMALL LETTER E WITH GRAVE
349 #x00EA ;; 144:LATIN SMALL LETTER E WITH CIRCUMFLEX
350 #x00EB ;; 145:LATIN SMALL LETTER E WITH DIAERESIS
351 #x00ED ;; 146:LATIN SMALL LETTER I WITH ACUTE
352 #x00EC ;; 147:LATIN SMALL LETTER I WITH GRAVE
353 #x00EE ;; 148:LATIN SMALL LETTER I WITH CIRCUMFLEX
354 #x00EF ;; 149:LATIN SMALL LETTER I WITH DIAERESIS
355 #x00F1 ;; 150:LATIN SMALL LETTER N WITH TILDE
356 #x00F3 ;; 151:LATIN SMALL LETTER O WITH ACUTE
357 #x00F2 ;; 152:LATIN SMALL LETTER O WITH GRAVE
358 #x00F4 ;; 153:LATIN SMALL LETTER O WITH CIRCUMFLEX
359 #x00F6 ;; 154:LATIN SMALL LETTER O WITH DIAERESIS
360 #x00F5 ;; 155:LATIN SMALL LETTER O WITH TILDE
361 #x00FA ;; 156:LATIN SMALL LETTER U WITH ACUTE
362 #x00F9 ;; 157:LATIN SMALL LETTER U WITH GRAVE
363 #x00FB ;; 158:LATIN SMALL LETTER U WITH CIRCUMFLEX
364 #x00FC ;; 159:LATIN SMALL LETTER U WITH DIAERESIS
365 #x2020 ;; 160:DAGGER
366 #x00B0 ;; 161:DEGREE SIGN
367 #x00A2 ;; 162:CENT SIGN
368 #x00A3 ;; 163:POUND SIGN
369 #x00A7 ;; 164:SECTION SIGN
370 #x2022 ;; 165:BULLET
371 #x00B6 ;; 166:PILCROW SIGN
372 #x00DF ;; 167:LATIN SMALL LETTER SHARP S
373 #x00AE ;; 168:REGISTERED SIGN
374 #x00A9 ;; 169:COPYRIGHT SIGN
375 #x2122 ;; 170:TRADE MARK SIGN
376 #x00B4 ;; 171:ACUTE ACCENT
377 #x00A8 ;; 172:DIAERESIS
378 #x2260 ;; 173:NOT EQUAL TO
379 #x00C6 ;; 174:LATIN CAPITAL LETTER AE
380 #x00D8 ;; 175:LATIN CAPITAL LETTER O WITH STROKE
381 #x221E ;; 176:INFINITY
382 #x00B1 ;; 177:PLUS-MINUS SIGN
383 #x2264 ;; 178:LESS-THAN OR EQUAL TO
384 #x2265 ;; 179:GREATER-THAN OR EQUAL TO
385 #x00A5 ;; 180:YEN SIGN
386 #x00B5 ;; 181:MICRO SIGN
387 #x2202 ;; 182:PARTIAL DIFFERENTIAL
388 #x2211 ;; 183:N-ARY SUMMATION
389 #x220F ;; 184:N-ARY PRODUCT
390 #x03C0 ;; 185:GREEK SMALL LETTER PI
391 #x222B ;; 186:INTEGRAL
392 #x00AA ;; 187:FEMININE ORDINAL INDICATOR
393 #x00BA ;; 188:MASCULINE ORDINAL INDICATOR
394 #x03A9 ;; 189:GREEK CAPITAL LETTER OMEGA
395 #x00E6 ;; 190:LATIN SMALL LETTER AE
396 #x00F8 ;; 191:LATIN SMALL LETTER O WITH STROKE
397 #x00BF ;; 192:INVERTED QUESTION MARK
398 #x00A1 ;; 193:INVERTED EXCLAMATION MARK
399 #x00AC ;; 194:NOT SIGN
400 #x221A ;; 195:SQUARE ROOT
401 #x0192 ;; 196:LATIN SMALL LETTER F WITH HOOK
402 #x2248 ;; 197:ALMOST EQUAL TO
403 #x2206 ;; 198:INCREMENT
404 #x00AB ;; 199:LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
405 #x00BB ;; 200:RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
406 #x2026 ;; 201:HORIZONTAL ELLIPSIS
407 #x00A0 ;; 202:NO-BREAK SPACE
408 #x00C0 ;; 203:LATIN CAPITAL LETTER A WITH GRAVE
409 #x00C3 ;; 204:LATIN CAPITAL LETTER A WITH TILDE
410 #x00D5 ;; 205:LATIN CAPITAL LETTER O WITH TILDE
411 #x0152 ;; 206:LATIN CAPITAL LIGATURE OE
412 #x0153 ;; 207:LATIN SMALL LIGATURE OE
413 #x2013 ;; 208:EN DASH
414 #x2014 ;; 209:EM DASH
415 #x201C ;; 210:LEFT DOUBLE QUOTATION MARK
416 #x201D ;; 211:RIGHT DOUBLE QUOTATION MARK
417 #x2018 ;; 212:LEFT SINGLE QUOTATION MARK
418 #x2019 ;; 213:RIGHT SINGLE QUOTATION MARK
419 #x00F7 ;; 214:DIVISION SIGN
420 #x25CA ;; 215:LOZENGE
421 #x00FF ;; 216:LATIN SMALL LETTER Y WITH DIAERESIS
422 #x0178 ;; 217:LATIN CAPITAL LETTER Y WITH DIAERESIS
423 #x2044 ;; 218:FRACTION SLASH
424 #x20AC ;; 219:EURO SIGN
425 #x2039 ;; 220:SINGLE LEFT-POINTING ANGLE QUOTATION MARK
426 #x203A ;; 221:SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
427 #xFB01 ;; 222:LATIN SMALL LIGATURE FI
428 #xFB02 ;; 223:LATIN SMALL LIGATURE FL
429 #x2021 ;; 224:DOUBLE DAGGER
430 #x00B7 ;; 225:MIDDLE DOT
431 #x201A ;; 226:SINGLE LOW-9 QUOTATION MARK
432 #x201E ;; 227:DOUBLE LOW-9 QUOTATION MARK
433 #x2030 ;; 228:PER MILLE SIGN
434 #x00C2 ;; 229:LATIN CAPITAL LETTER A WITH CIRCUMFLEX
435 #x00CA ;; 230:LATIN CAPITAL LETTER E WITH CIRCUMFLEX
436 #x00C1 ;; 231:LATIN CAPITAL LETTER A WITH ACUTE
437 #x00CB ;; 232:LATIN CAPITAL LETTER E WITH DIAERESIS
438 #x00C8 ;; 233:LATIN CAPITAL LETTER E WITH GRAVE
439 #x00CD ;; 234:LATIN CAPITAL LETTER I WITH ACUTE
440 #x00CE ;; 235:LATIN CAPITAL LETTER I WITH CIRCUMFLEX
441 #x00CF ;; 236:LATIN CAPITAL LETTER I WITH DIAERESIS
442 #x00CC ;; 237:LATIN CAPITAL LETTER I WITH GRAVE
443 #x00D3 ;; 238:LATIN CAPITAL LETTER O WITH ACUTE
444 #x00D4 ;; 239:LATIN CAPITAL LETTER O WITH CIRCUMFLEX
445 #xF8FF ;; 240:Apple logo
446 #x00D2 ;; 241:LATIN CAPITAL LETTER O WITH GRAVE
447 #x00DA ;; 242:LATIN CAPITAL LETTER U WITH ACUTE
448 #x00DB ;; 243:LATIN CAPITAL LETTER U WITH CIRCUMFLEX
449 #x00D9 ;; 244:LATIN CAPITAL LETTER U WITH GRAVE
450 #x0131 ;; 245:LATIN SMALL LETTER DOTLESS I
451 #x02C6 ;; 246:MODIFIER LETTER CIRCUMFLEX ACCENT
452 #x02DC ;; 247:SMALL TILDE
453 #x00AF ;; 248:MACRON
454 #x02D8 ;; 249:BREVE
455 #x02D9 ;; 250:DOT ABOVE
456 #x02DA ;; 251:RING ABOVE
457 #x00B8 ;; 252:CEDILLA
458 #x02DD ;; 253:DOUBLE ACUTE ACCENT
459 #x02DB ;; 254:OGONEK
460 #x02C7 ;; 255:CARON
461 ])
462 translation-table)
463 (while (< i 128)
464 (aset encoding-vector i i)
465 (setq i (1+ i)))
466 (while (< i 256)
467 (aset encoding-vector i
468 (decode-char 'ucs (aref vec (- i 128))))
469 (setq i (1+ i)))
470 (setq translation-table
471 (make-translation-table-from-vector encoding-vector))
472 (define-translation-table 'mac-roman-decoder translation-table)
473 (define-translation-table 'mac-roman-encoder
474 (char-table-extra-slot translation-table 0)))
475
476 (define-ccl-program decode-mac-roman
477 `(4
478 ((loop
479 (read r1)
480 (if (r1 < 128) ;; ASCII
481 (r0 = ,(charset-id 'ascii))
482 (if (r0 < 160)
483 (r0 = ,(charset-id 'eight-bit-control))
484 (r0 = ,(charset-id 'eight-bit-graphic))))
485 (translate-character mac-roman-decoder r0 r1)
486 (write-multibyte-character r0 r1)
487 (repeat))))
488 "CCL program to decode Mac Roman")
489
490 (define-ccl-program encode-mac-roman
491 `(1
492 ((loop
493 (read-multibyte-character r0 r1)
494 (translate-character mac-roman-encoder r0 r1)
495 (write-repeat r1))))
496 "CCL program to encode Mac Roman")
497
498 (make-coding-system
499 'mac-roman 4 ?M "Mac Roman Encoding"
500 '(decode-mac-roman . encode-mac-roman)
501 '((safe-chars . mac-roman-encoder)
502 (valid-codes (0 . 255))))
503
504 (provide 'european)
505
506 ;;; european.el ends here