annotate lisp/language/cyrillic.el @ 46541:021204d82a30

Improve comment of vc-BACKEND-workfile-unchanged-p.
author André Spiegel <spiegel@gnu.org>
date Fri, 19 Jul 2002 13:20:02 +0000
parents 81c9cd627d93
children 2ff3f5116672
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 37112
diff changeset
1 ;;; cyrillic.el --- support for Cyrillic -*- coding: iso-2022-7bit; -*-
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
18454
b44129078db3 Update copyright notice.
Richard M. Stallman <rms@gnu.org>
parents: 18308
diff changeset
4 ;; Licensed to the Free Software Foundation.
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
5 ;; Copyright (C) 2001, 2002 Free Software Foundation, Inc.
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
7 ;; Author: Kenichi Handa <handa@etl.go.jp>
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
8 ;; Keywords: multilingual, Cyrillic, i18n
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
11
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
15 ;; any later version.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
20 ;; GNU General Public License for more details.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
21
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
17071
70194012fb3a Fix FSF address in comment.
Karl Heuer <kwzh@gnu.org>
parents: 17052
diff changeset
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
70194012fb3a Fix FSF address in comment.
Karl Heuer <kwzh@gnu.org>
parents: 17052
diff changeset
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
70194012fb3a Fix FSF address in comment.
Karl Heuer <kwzh@gnu.org>
parents: 17052
diff changeset
25 ;; Boston, MA 02111-1307, USA.
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
26
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
27 ;;; Commentary:
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
28
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
29 ;; The character set ISO8859-5 is supported. KOI-8 and ALTERNATIVNYJ
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
30 ;; are converted to Unicode internally. See
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
31 ;; <URL:http://www.ecma.ch/ecma1/STAND/ECMA-113.HTM>. For more info
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
32 ;; on Cyrillic charsets, see
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
33 ;; <URL:http://czyborra.com/charsets/cyrillic.html>. The KOI and
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
34 ;; Alternativnyj coding systems should live in code-pages.el, but
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
35 ;; they've always been preloaded and the coding system autoload
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
36 ;; mechanism didn't get accepted, so they have to stay here and
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
37 ;; duplicate code-pages stuff.
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
38
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
39 ;; Note that 8859-5 maps directly onto the Unicode Cyrillic block,
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
40 ;; apart from codepoints 160 (NBSP, c.f. U+0400), 173 (soft hyphen,
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
41 ;; c.f. U+04OD) and 253 (section sign, c.f U+045D). The KOI-8 and
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
42 ;; Alternativnyj coding systems encode both 8859-5 and Unicode.
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
43 ;; ucs-tables.el provides unification for cyrillic-iso-8bit.
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
44
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
45 ;; Customizing `utf-8-fragment-on-decoding' allows decoding characters
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
46 ;; from KOI and Alternativnyj into 8859-5 where that's possible.
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
47 ;; cyrillic-iso8859-5 characters take half as much space in the buffer
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
48 ;; as the mule-unicode-0100-24ff equivalents, though that's probably
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
49 ;; not normally a big deal.
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
50
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
51 ;;; Code:
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
52
19451
933bea774c3c Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents: 18520
diff changeset
53 ;; Cyrillic (general)
933bea774c3c Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents: 18520
diff changeset
54
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
55 ;; ISO-8859-5 stuff
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
56
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
57 (make-coding-system
18308
b8622afb8a6e Don't make the keymap
Kenichi Handa <handa@m17n.org>
parents: 18203
diff changeset
58 'cyrillic-iso-8bit 2 ?5
42152
e3ae5ef41293 Improving doc strings.
Werner LEMBERG <wl@gnu.org>
parents: 38414
diff changeset
59 "ISO 2022 based 8-bit encoding for Cyrillic script (MIME:ISO-8859-5)."
20745
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
60 '(ascii cyrillic-iso8859-5 nil nil
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
61 nil nil nil nil nil nil nil)
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
62 '((safe-charsets ascii cyrillic-iso8859-5)
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
63 (mime-charset . iso-8859-5)))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
64
18520
383d11185239 Swap args to define-coding-system-alias.
Richard M. Stallman <rms@gnu.org>
parents: 18454
diff changeset
65 (define-coding-system-alias 'iso-8859-5 'cyrillic-iso-8bit)
18308
b8622afb8a6e Don't make the keymap
Kenichi Handa <handa@m17n.org>
parents: 18203
diff changeset
66
19451
933bea774c3c Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents: 18520
diff changeset
67 (set-language-info-alist
22983
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
68 "Cyrillic-ISO" '((charset cyrillic-iso8859-5)
20745
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
69 (coding-system cyrillic-iso-8bit)
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
70 (coding-priority cyrillic-iso-8bit)
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
71 (input-method . "cyrillic-yawerty") ; fixme
22983
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
72 (nonascii-translation . cyrillic-iso8859-5)
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
73 (unibyte-display . cyrillic-iso-8bit)
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
74 (features cyril-util)
19451
933bea774c3c Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents: 18520
diff changeset
75 (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!")
20745
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
76 (documentation . "Support for Cyrillic ISO-8859-5."))
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
77 '("Cyrillic"))
19451
933bea774c3c Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents: 18520
diff changeset
78
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
79 ;; KOI-8R stuff
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
80
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
81 ;; The mule-unicode portion of this is from
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
82 ;; http://www.unicode.org/Public/MAPPINGS/VENDORS/MISC/KOI8-R.TXT,
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
83 ;; which references RFC 1489.
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
84 (defvar cyrillic-koi8-r-decode-table
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
85 [
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
86 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
87 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
88 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
89 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
90 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
91 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
92 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
93 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
94 ;; 8859-5 plus Unicode
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
95 ?$,2 (B ?$,2 "(B ?$,2 ,(B ?$,2 0(B ?$,2 4(B ?$,2 8(B ?$,2 <(B ?$,2 D(B ?$,2 L(B ?$,2 T(B ?$,2 \(B ?$,2!@(B ?$,2!D(B ?$,2!H(B ?$,2!L(B ?$,2!P(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
96 ?$,2!Q(B ?$,2!R(B ?$,2!S(B ?$,1{ (B ?$,2!`(B ?$,1s"(B ?$,1x:(B ?$,1xh(B ?$,1y$(B ?$,1y%(B ?,L (B ?$,1{!(B ?,A0(B ?,A2(B ?,A7(B ?,Aw(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
97 ?$,2 p(B ?$,2 q(B ?$,2 r(B ?,Lq(B ?$,2 s(B ?$,2 t(B ?$,2 u(B ?$,2 v(B ?$,2 w(B ?$,2 x(B ?$,2 y(B ?$,2 z(B ?$,2 {(B ?$,2 |(B ?$,2 }(B ?$,2 ~(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
98 ?$,2 (B ?$,2! (B ?$,2!!(B ?,L!(B ?$,2!"(B ?$,2!#(B ?$,2!$(B ?$,2!%(B ?$,2!&(B ?$,2!'(B ?$,2!((B ?$,2!)(B ?$,2!*(B ?$,2!+(B ?$,2!,(B ?,A)(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
99 ?,Ln(B ?,LP(B ?,LQ(B ?,Lf(B ?,LT(B ?,LU(B ?,Ld(B ?,LS(B ?,Le(B ?,LX(B ?,LY(B ?,LZ(B ?,L[(B ?,L\(B ?,L](B ?,L^(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
100 ?,L_(B ?,Lo(B ?,L`(B ?,La(B ?,Lb(B ?,Lc(B ?,LV(B ?,LR(B ?,Ll(B ?,Lk(B ?,LW(B ?,Lh(B ?,Lm(B ?,Li(B ?,Lg(B ?,Lj(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
101 ?,LN(B ?,L0(B ?,L1(B ?,LF(B ?,L4(B ?,L5(B ?,LD(B ?,L3(B ?,LE(B ?,L8(B ?,L9(B ?,L:(B ?,L;(B ?,L<(B ?,L=(B ?,L>(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
102 ?,L?(B ?,LO(B ?,L@(B ?,LA(B ?,LB(B ?,LC(B ?,L6(B ?,L2(B ?,LL(B ?,LK(B ?,L7(B ?,LH(B ?,LM(B ?,LI(B ?,LG(B ?,LJ(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
103 ;; All Unicode:
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
104 ;; ?$,2 (B ?$,2 "(B ?$,2 ,(B ?$,2 0(B ?$,2 4(B ?$,2 8(B ?$,2 <(B ?$,2 D(B ?$,2 L(B ?$,2 T(B ?$,2 \(B ?$,2!@(B ?$,2!D(B ?$,2!H(B ?$,2!L(B ?$,2!P(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
105 ;; ?$,2!Q(B ?$,2!R(B ?$,2!S(B ?$,1{ (B ?$,2!`(B ?$,1s"(B ?$,1x:(B ?$,1xh(B ?$,1y$(B ?$,1y%(B ?,A (B ?$,1{!(B ?,A0(B ?,A2(B ?,A7(B ?,Aw(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
106 ;; ?$,2 p(B ?$,2 q(B ?$,2 r(B ?$,1(q(B ?$,2 s(B ?$,2 t(B ?$,2 u(B ?$,2 v(B ?$,2 w(B ?$,2 x(B ?$,2 y(B ?$,2 z(B ?$,2 {(B ?$,2 |(B ?$,2 }(B ?$,2 ~(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
107 ;; ?$,2 (B ?$,2! (B ?$,2!!(B ?$,1(!(B ?$,2!"(B ?$,2!#(B ?$,2!$(B ?$,2!%(B ?$,2!&(B ?$,2!'(B ?$,2!((B ?$,2!)(B ?$,2!*(B ?$,2!+(B ?$,2!,(B ?,A)(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
108 ;; ?$,1(n(B ?$,1(P(B ?$,1(Q(B ?$,1(f(B ?$,1(T(B ?$,1(U(B ?$,1(d(B ?$,1(S(B ?$,1(e(B ?$,1(X(B ?$,1(Y(B ?$,1(Z(B ?$,1([(B ?$,1(\(B ?$,1(](B ?$,1(^(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
109 ;; ?$,1(_(B ?$,1(o(B ?$,1(`(B ?$,1(a(B ?$,1(b(B ?$,1(c(B ?$,1(V(B ?$,1(R(B ?$,1(l(B ?$,1(k(B ?$,1(W(B ?$,1(h(B ?$,1(m(B ?$,1(i(B ?$,1(g(B ?$,1(j(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
110 ;; ?$,1(N(B ?$,1(0(B ?$,1(1(B ?$,1(F(B ?$,1(4(B ?$,1(5(B ?$,1(D(B ?$,1(3(B ?$,1(E(B ?$,1(8(B ?$,1(9(B ?$,1(:(B ?$,1(;(B ?$,1(<(B ?$,1(=(B ?$,1(>(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
111 ;; ?$,1(?(B ?$,1(O(B ?$,1(@(B ?$,1(A(B ?$,1(B(B ?$,1(C(B ?$,1(6(B ?$,1(2(B ?$,1(L(B ?$,1(K(B ?$,1(7(B ?$,1(H(B ?$,1(M(B ?$,1(I(B ?$,1(G(B ?$,1(J(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
112 ]
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
113 "Cyrillic KOI8-R decoding table.")
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
114
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
115 (let ((table (make-translation-table-from-vector
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
116 cyrillic-koi8-r-decode-table)))
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
117 (define-translation-table 'cyrillic-koi8-r-nonascii-translation-table table)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
118 (define-translation-table 'cyrillic-koi8-r-encode-table
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
119 (char-table-extra-slot table 0)))
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
120
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
121 ;; No point in keeping it around. (It can't be let-bound, since it's
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
122 ;; needed for macro expansion.)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
123 (makunbound 'cyrillic-koi8-r-decode-table)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
124
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
125 (define-ccl-program ccl-decode-koi8
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
126 `(4
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
127 ((loop
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
128 (r0 = 0)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
129 (read r1)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
130 (if (r1 < 128)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
131 (write-repeat r1)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
132 ((translate-character cyrillic-koi8-r-nonascii-translation-table r0 r1)
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
133 (translate-character utf-8-translation-table-for-decode r0 r1)
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
134 (write-multibyte-character r0 r1)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
135 (repeat))))))
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
136 "CCL program to decode KOI8-R.")
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
137
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
138 (define-ccl-program ccl-encode-koi8
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
139 `(1
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
140 ((loop
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
141 (read-multibyte-character r0 r1)
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
142 (translate-character cyrillic-koi8-r-encode-table r0 r1)
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
143 (write-repeat r1))))
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
144 "CCL program to encode KOI8-R.")
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
145
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
146 (defun cyrillic-unify-encoding (table)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
147 "Set up equivalent characters in the encoding TABLE.
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
148 This works wheher or not the table is is Unicode-based or
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
149 8859-5-based. (Only appropriate for Cyrillic.)"
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
150 (let ((table (get table 'translation-table)))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
151 (dotimes (i 96)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
152 (let* ((c (make-char 'cyrillic-iso8859-5 (+ i 32)))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
153 (u ; equivalent Unicode char
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
154 (cond ((eq c ?,L (B) ?,A (B)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
155 ((eq c ?,L-(B) ?,A-(B)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
156 ((eq c ?,L}(B) ?,A'(B)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
157 (t (decode-char 'ucs (+ #x400 i)))))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
158 (ec (aref table c)) ; encoding of 8859-5
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
159 (uc (aref table u))) ; encoding of Unicode
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
160 (unless (memq c '(?,L (B ?,L-(B ?,L}(B)) ; 8859-5 exceptions
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
161 (unless uc
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
162 (aset table u ec))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
163 (unless ec
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
164 (aset table c uc)))))))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
165
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
166 (cyrillic-unify-encoding 'cyrillic-koi8-r-encode-table)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
167
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
168 (make-coding-system
18203
0745f30aec66 Adjusted for coding system name change.
Kenichi Handa <handa@m17n.org>
parents: 18155
diff changeset
169 'cyrillic-koi8 4
18116
7839aa2f6765 (koi8-r): Use R for mode line.
Richard M. Stallman <rms@gnu.org>
parents: 17993
diff changeset
170 ;; We used to use ?K. It is true that ?K is more strictly correct,
7839aa2f6765 (koi8-r): Use R for mode line.
Richard M. Stallman <rms@gnu.org>
parents: 17993
diff changeset
171 ;; but it is also used for Korean.
7839aa2f6765 (koi8-r): Use R for mode line.
Richard M. Stallman <rms@gnu.org>
parents: 17993
diff changeset
172 ;; So people who use koi8 for languages other than Russian
7839aa2f6765 (koi8-r): Use R for mode line.
Richard M. Stallman <rms@gnu.org>
parents: 17993
diff changeset
173 ;; will have to forgive us.
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
174 ?R "KOI8-R 8-bit encoding for Cyrillic (MIME: KOI8-R)."
21663
a03ddc4a728b FLAGS arguments for make-coding-system changed.
Kenichi Handa <handa@m17n.org>
parents: 20745
diff changeset
175 '(ccl-decode-koi8 . ccl-encode-koi8)
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
176 `((safe-chars . cyrillic-koi8-r-encode-table)
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
177 (mime-charset . koi8-r)
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
178 (valid-codes (0 . 255))))
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
179
18520
383d11185239 Swap args to define-coding-system-alias.
Richard M. Stallman <rms@gnu.org>
parents: 18454
diff changeset
180 (define-coding-system-alias 'koi8-r 'cyrillic-koi8)
383d11185239 Swap args to define-coding-system-alias.
Richard M. Stallman <rms@gnu.org>
parents: 18454
diff changeset
181 (define-coding-system-alias 'koi8 'cyrillic-koi8)
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
182 (define-coding-system-alias 'cp878 'cyrillic-koi8)
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
183
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
184 ;; Allow displaying some of KOI & al with an 8859-5-encoded font. We
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
185 ;; won't bother about the exceptions when encoding the font, since
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
186 ;; NBSP will fall through below and work anyhow, and we'll have
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
187 ;; avoided setting the fontset for the other two to 8859-5 -- they're
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
188 ;; not in KOI and Alternativnyj anyhow.
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
189 (define-ccl-program ccl-encode-8859-5-font
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
190 `(0
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
191 ((if (r0 == ,(charset-id 'cyrillic-iso8859-5))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
192 (r1 += 128)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
193 (if (r0 == ,(charset-id 'mule-unicode-0100-24ff))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
194 (r1 = (r2 + 128))))))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
195 "Encode ISO 8859-5 and Cyrillic Unicode chars to 8859-5 font.")
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
196
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
197 (add-to-list 'font-ccl-encoder-alist '("iso8859-5" . ccl-encode-8859-5-font))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
198
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
199 ;; The table is set up later to encode both Unicode and 8859-5.
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
200 (define-ccl-program ccl-encode-koi8-font
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
201 `(0
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
202 (translate-character cyrillic-koi8-r-encode-table r0 r1))
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
203 "CCL program to encode Cyrillic chars to KOI font.")
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
204
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
205 (add-to-list 'font-ccl-encoder-alist '("koi8" . ccl-encode-koi8-font))
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
206
19451
933bea774c3c Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents: 18520
diff changeset
207 (set-language-info-alist
22983
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
208 "Cyrillic-KOI8" `((charset cyrillic-iso8859-5)
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
209 (nonascii-translation
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
210 . ,(get 'cyrillic-koi8-r-nonascii-translation-table
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
211 'translation-table))
20745
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
212 (coding-system cyrillic-koi8)
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
213 (coding-priority cyrillic-koi8 cyrillic-iso-8bit)
24946
0856eb4dd6ec ("Cyrillic-KOI8", "Cyrillic-ALT"): Use cyrillic-jcuken as default input method.
Richard M. Stallman <rms@gnu.org>
parents: 24297
diff changeset
214 (input-method . "cyrillic-jcuken")
22983
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
215 (features cyril-util)
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
216 (unibyte-display . cyrillic-koi8)
19451
933bea774c3c Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents: 18520
diff changeset
217 (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!")
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
218 (documentation . "Support for Cyrillic KOI8-R."))
20745
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
219 '("Cyrillic"))
19451
933bea774c3c Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents: 18520
diff changeset
220
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
221
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
222 (defvar cyrillic-koi8-u-decode-table
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
223 [
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
224 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
225 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
226 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
227 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
228 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
229 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
230 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
231 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
232 ;; All Unicode:
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
233 ;; ?$,2 (B ?$,2 "(B ?$,2 ,(B ?$,2 0(B ?$,2 4(B ?$,2 8(B ?$,2 <(B ?$,2 D(B ?$,2 L(B ?$,2 T(B ?$,2 \(B ?$,2!@(B ?$,2!D(B ?$,2!H(B ?$,2!L(B ?$,2!P(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
234 ;; ?$,2!Q(B ?$,2!R(B ?$,2!S(B ?$,1{ (B ?$,2!`(B ?$,1x9(B ?$,1x:(B ?$,1xh(B ?$,1y$(B ?$,1y%(B ?,L (B ?$,1{!(B ?,A0(B ?,A2(B ?,A7(B ?,Aw(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
235 ;; ?$,2 p(B ?$,2 q(B ?$,2 r(B ?$,1(q(B ?$,1(t(B ?$,2 t(B ?$,1(v(B ?$,1(w(B ?$,2 w(B ?$,2 x(B ?$,2 y(B ?$,2 z(B ?$,2 {(B ?$,1)Q(B ?$,2 }(B ?$,2 ~(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
236 ;; ?$,2 (B ?$,2! (B ?$,2!!(B ?$,1(!(B ?$,1($(B ?$,2!#(B ?$,1(&(B ?$,1('(B ?$,2!&(B ?$,2!'(B ?$,2!((B ?$,2!)(B ?$,2!*(B ?$,1)P(B ?$,2!,(B ?,A)(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
237 ;; ?$,1(n(B ?$,1(P(B ?$,1(Q(B ?$,1(f(B ?$,1(T(B ?$,1(U(B ?$,1(d(B ?$,1(S(B ?$,1(e(B ?$,1(X(B ?$,1(Y(B ?$,1(Z(B ?$,1([(B ?$,1(\(B ?$,1(](B ?$,1(^(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
238 ;; ?$,1(_(B ?$,1(o(B ?$,1(`(B ?$,1(a(B ?$,1(b(B ?$,1(c(B ?$,1(V(B ?$,1(R(B ?$,1(l(B ?$,1(k(B ?$,1(W(B ?$,1(h(B ?$,1(m(B ?$,1(i(B ?$,1(g(B ?$,1(j(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
239 ;; ?$,1(N(B ?$,1(0(B ?$,1(1(B ?$,1(F(B ?$,1(4(B ?$,1(5(B ?$,1(D(B ?$,1(3(B ?$,1(E(B ?$,1(8(B ?$,1(9(B ?$,1(:(B ?$,1(;(B ?$,1(<(B ?$,1(=(B ?$,1(>(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
240 ;; ?$,1(?(B ?$,1(O(B ?$,1(@(B ?$,1(A(B ?$,1(B(B ?$,1(C(B ?$,1(6(B ?$,1(2(B ?$,1(L(B ?$,1(K(B ?$,1(7(B ?$,1(H(B ?$,1(M(B ?$,1(I(B ?$,1(G(B ?$,1(J(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
241 ;; 8859-5 plus Unicode:
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
242 ?$,2 (B ?$,2 "(B ?$,2 ,(B ?$,2 0(B ?$,2 4(B ?$,2 8(B ?$,2 <(B ?$,2 D(B ?$,2 L(B ?$,2 T(B ?$,2 \(B ?$,2!@(B ?$,2!D(B ?$,2!H(B ?$,2!L(B ?$,2!P(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
243 ?$,2!Q(B ?$,2!R(B ?$,2!S(B ?$,1{ (B ?$,2!`(B ?$,1x9(B ?$,1x:(B ?$,1xh(B ?$,1y$(B ?$,1y%(B ?,L (B ?$,1{!(B ?,A0(B ?,A2(B ?,A7(B ?,Aw(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
244 ?$,2 p(B ?$,2 q(B ?$,2 r(B ?,Lq(B ?,Lt(B ?$,2 t(B ?,Lv(B ?,Lw(B ?$,2 w(B ?$,2 x(B ?$,2 y(B ?$,2 z(B ?$,2 {(B ?$,1)Q(B ?$,2 }(B ?$,2 ~(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
245 ?$,2 (B ?$,2! (B ?$,2!!(B ?,L!(B ?,L$(B ?$,2!#(B ?,L&(B ?,L'(B ?$,2!&(B ?$,2!'(B ?$,2!((B ?$,2!)(B ?$,2!*(B ?$,1)P(B ?$,2!,(B ?,A)(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
246 ?,Ln(B ?,LP(B ?,LQ(B ?,Lf(B ?,LT(B ?,LU(B ?,Ld(B ?,LS(B ?,Le(B ?,LX(B ?,LY(B ?,LZ(B ?,L[(B ?,L\(B ?,L](B ?,L^(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
247 ?,L_(B ?,Lo(B ?,L`(B ?,La(B ?,Lb(B ?,Lc(B ?,LV(B ?,LR(B ?,Ll(B ?,Lk(B ?,LW(B ?,Lh(B ?,Lm(B ?,Li(B ?,Lg(B ?,Lj(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
248 ?,LN(B ?,L0(B ?,L1(B ?,LF(B ?,L4(B ?,L5(B ?,LD(B ?,L3(B ?,LE(B ?,L8(B ?,L9(B ?,L:(B ?,L;(B ?,L<(B ?,L=(B ?,L>(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
249 ?,L?(B ?,LO(B ?,L@(B ?,LA(B ?,LB(B ?,LC(B ?,L6(B ?,L2(B ?,LL(B ?,LK(B ?,L7(B ?,LH(B ?,LM(B ?,LI(B ?,LG(B ?,LJ(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
250 ]
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
251 "Cyrillic KOI8-U decoding table.")
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
252
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
253 (let ((table (make-translation-table-from-vector
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
254 cyrillic-koi8-u-decode-table)))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
255 (define-translation-table 'cyrillic-koi8-u-nonascii-translation-table table)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
256 (define-translation-table 'cyrillic-koi8-u-encode-table
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
257 (char-table-extra-slot table 0)))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
258
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
259 (makunbound 'cyrillic-koi8-u-decode-table)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
260
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
261 (define-ccl-program ccl-decode-koi8-u
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
262 `(4
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
263 ((loop
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
264 (r0 = 0)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
265 (read r1)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
266 (if (r1 < 128)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
267 (write-repeat r1)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
268 ((translate-character cyrillic-koi8-u-nonascii-translation-table r0 r1)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
269 (translate-character utf-8-translation-table-for-decode r0 r1)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
270 (write-multibyte-character r0 r1)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
271 (repeat))))))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
272 "CCL program to decode KOI8-U.")
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
273
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
274 (define-ccl-program ccl-encode-koi8-u
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
275 `(1
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
276 ((loop
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
277 (read-multibyte-character r0 r1)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
278 (translate-character cyrillic-koi8-u-encode-table r0 r1)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
279 (write-repeat r1))))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
280 "CCL program to encode KOI8-U.")
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
281
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
282 (cyrillic-unify-encoding 'cyrillic-koi8-u-encode-table)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
283
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
284 (make-coding-system
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
285 'koi8-u 4
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
286 ?U "KOI8-U 8-bit encoding for Cyrillic (MIME: KOI8-U)"
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
287 '(ccl-decode-koi8-u . ccl-encode-koi8-u)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
288 `((safe-chars . cyrillic-koi8-u-encode-table)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
289 (mime-charset . koi8-u)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
290 (valid-codes (0 . 255))))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
291
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
292 (define-ccl-program ccl-encode-koi8-u-font
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
293 `(0
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
294 (translate-character cyrillic-koi8-u-encode-table r0 r1))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
295 "CCL program to encode Cyrillic chars to KOI-U font.")
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
296
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
297 (add-to-list 'font-ccl-encoder-alist '("koi8-u" . ccl-encode-koi8-u-font))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
298
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
299 (set-language-info-alist
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
300 "Ukrainian" `((coding-system koi8-u)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
301 (coding-priority koi8-u)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
302 (nonascii-translation
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
303 . ,(get 'cyrillic-koi8-r-nonascii-translation-table
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
304 'translation-table))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
305 (input-method . "ukrainian-computer")
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
306 (features code-pages)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
307 (documentation
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
308 . "Support for Ukrainian with koi8-u character set."))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
309 '("Cyrillic"))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
310
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
311 ;;; ALTERNATIVNYJ stuff
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
312
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
313 (defvar cyrillic-alternativnyj-decode-table
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
314 [
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
315 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
316 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
317 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
318 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
319 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
320 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
321 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
322 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
323 ;; ?$,1(0(B ?$,1(1(B ?$,1(2(B ?$,1(3(B ?$,1(4(B ?$,1(5(B ?$,1(6(B ?$,1(7(B ?$,1(8(B ?$,1(9(B ?$,1(:(B ?$,1(;(B ?$,1(<(B ?$,1(=(B ?$,1(>(B ?$,1(?(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
324 ;; ?$,1(@(B ?$,1(A(B ?$,1(B(B ?$,1(C(B ?$,1(D(B ?$,1(E(B ?$,1(F(B ?$,1(G(B ?$,1(H(B ?$,1(I(B ?$,1(J(B ?$,1(K(B ?$,1(L(B ?$,1(M(B ?$,1(N(B ?$,1(O(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
325 ;; ?$,1(P(B ?$,1(Q(B ?$,1(R(B ?$,1(S(B ?$,1(T(B ?$,1(U(B ?$,1(V(B ?$,1(W(B ?$,1(X(B ?$,1(Y(B ?$,1(Z(B ?$,1([(B ?$,1(\(B ?$,1(](B ?$,1(^(B ?$,1(_(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
326 ;; ?$,2!Q(B ?$,2!R(B ?$,2!S(B ?$,2 "(B ?$,2 D(B ?$,2!!(B ?$,2!"(B ?$,2 v(B ?$,2 u(B ?$,2!#(B ?$,2 q(B ?$,2 w(B ?$,2 }(B ?$,2 |(B ?$,2 {(B ?$,2 0(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
327 ;; ?$,2 4(B ?$,2 T(B ?$,2 L(B ?$,2 <(B ?$,2 (B ?$,2 \(B ?$,2 ~(B ?$,2 (B ?$,2 z(B ?$,2 t(B ?$,2!)(B ?$,2!&(B ?$,2! (B ?$,2 p(B ?$,2!,(B ?$,2!'(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
328 ;; ?$,2!((B ?$,2!$(B ?$,2!%(B ?$,2 y(B ?$,2 x(B ?$,2 r(B ?$,2 s(B ?$,2!+(B ?$,2!*(B ?$,2 8(B ?$,2 ,(B ?$,2!H(B ?$,2!D(B ?$,2!L(B ?$,2!P(B ?$,2!@(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
329 ;; ?$,1(`(B ?$,1(a(B ?$,1(b(B ?$,1(c(B ?$,1(d(B ?$,1(e(B ?$,1(f(B ?$,1(g(B ?$,1(h(B ?$,1(i(B ?$,1(j(B ?$,1(k(B ?$,1(l(B ?$,1(m(B ?$,1(n(B ?$,1(o(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
330 ;; ?$,1(!(B ?$,1(q(B ?$,1($(B ?$,1(t(B ?$,1('(B ?$,1(w(B ?$,1(.(B ?$,1(~(B ?,A0(B ?$,1s"(B ?,A7(B ?$,1x:(B ?$,1uV(B ?,A$(B ?$,2!`(B ?,A (B ;
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
331 ;; 8859+Unicode
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
332 ?,L0(B ?,L1(B ?,L2(B ?,L3(B ?,L4(B ?,L5(B ?,L6(B ?,L7(B ?,L8(B ?,L9(B ?,L:(B ?,L;(B ?,L<(B ?,L=(B ?,L>(B ?,L?(B
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
333 ?,L@(B ?,LA(B ?,LB(B ?,LC(B ?,LD(B ?,LE(B ?,LF(B ?,LG(B ?,LH(B ?,LI(B ?,LJ(B ?,LK(B ?,LL(B ?,LM(B ?,LN(B ?,LO(B
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
334 ?,LP(B ?,LQ(B ?,LR(B ?,LS(B ?,LT(B ?,LU(B ?,LV(B ?,LW(B ?,LX(B ?,LY(B ?,LZ(B ?,L[(B ?,L\(B ?,L](B ?,L^(B ?,L_(B
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
335 ?$,2!Q(B ?$,2!R(B ?$,2!S(B ?$,2 "(B ?$,2 D(B ?$,2!!(B ?$,2!"(B ?$,2 v(B ?$,2 u(B ?$,2!#(B ?$,2 q(B ?$,2 w(B ?$,2 }(B ?$,2 |(B ?$,2 {(B ?$,2 0(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
336 ?$,2 4(B ?$,2 T(B ?$,2 L(B ?$,2 <(B ?$,2 (B ?$,2 \(B ?$,2 ~(B ?$,2 (B ?$,2 z(B ?$,2 t(B ?$,2!)(B ?$,2!&(B ?$,2! (B ?$,2 p(B ?$,2!,(B ?$,2!'(B
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
337 ?$,2!((B ?$,2!$(B ?$,2!%(B ?$,2 y(B ?$,2 x(B ?$,2 r(B ?$,2 s(B ?$,2!+(B ?$,2!*(B ?$,2 8(B ?$,2 ,(B ?$,2!H(B ?$,2!D(B ?$,2!L(B ?$,2!P(B ?$,2!@(B
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
338 ?,L`(B ?,La(B ?,Lb(B ?,Lc(B ?,Ld(B ?,Le(B ?,Lf(B ?,Lg(B ?,Lh(B ?,Li(B ?,Lj(B ?,Lk(B ?,Ll(B ?,Lm(B ?,Ln(B ?,Lo(B
45639
86424df72c8b (cyrillic-alternativnyj-decode-table): Fix the table to contain correct
Pavel Janík <Pavel@Janik.cz>
parents: 42152
diff changeset
339 ?,L!(B ?,Lq(B ?,L$(B ?,Lt(B ?,L'(B ?,Lw(B ?,L.(B ?,L~(B 248 249 250 251 ?,Lp(B 253 254 ?,L (B]
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
340 "Cyrillic ALTERNATIVNYJ decoding table.")
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
341
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
342 (let ((table (make-translation-table-from-vector
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
343 cyrillic-alternativnyj-decode-table)))
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
344 (define-translation-table 'cyrillic-alternativnyj-nonascii-translation-table
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
345 table)
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
346 (define-translation-table 'cyrillic-alternativnyj-encode-table
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
347 (char-table-extra-slot table 0)))
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
348
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
349 (makunbound 'cyrillic-alternativnyj-decode-table)
22881
e0e17bbd8e6c (cyrillic-koi8-r-decode-table): New
Kenichi Handa <handa@m17n.org>
parents: 21663
diff changeset
350
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
351 (define-ccl-program ccl-decode-alternativnyj
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
352 `(4
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
353 ((loop
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
354 (r0 = 0)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
355 (read r1)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
356 (if (r1 < 128)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
357 (write-repeat r1)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
358 ((translate-character cyrillic-alternativnyj-nonascii-translation-table
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
359 r0 r1)
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
360 (translate-character utf-8-translation-table-for-decode r0 r1)
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
361 (write-multibyte-character r0 r1)
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
362 (repeat))))))
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
363 "CCL program to decode Alternativnyj.")
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
364
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
365 (define-ccl-program ccl-encode-alternativnyj
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
366 `(1
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
367 ((loop
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
368 (read-multibyte-character r0 r1)
30495
491e0864dd18 (cyrillic-koi8): Use `safe-chars' property instead of `safe-charsets'.
Kenichi Handa <handa@m17n.org>
parents: 29453
diff changeset
369 (translate-character cyrillic-alternativnyj-encode-table r0 r1)
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
370 (write-repeat r1))))
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
371 "CCL program to encode Alternativnyj.")
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
372
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
373 (cyrillic-unify-encoding 'cyrillic-alternativnyj-encode-table)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
374
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
375 (make-coding-system
18308
b8622afb8a6e Don't make the keymap
Kenichi Handa <handa@m17n.org>
parents: 18203
diff changeset
376 'cyrillic-alternativnyj 4 ?A
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
377 "ALTERNATIVNYJ (CP866) 8-bit encoding for Cyrillic."
21663
a03ddc4a728b FLAGS arguments for make-coding-system changed.
Kenichi Handa <handa@m17n.org>
parents: 20745
diff changeset
378 '(ccl-decode-alternativnyj . ccl-encode-alternativnyj)
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
379 `((safe-chars . cyrillic-alternativnyj-encode-table)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
380 (valid-codes (0 . 255))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
381 (mime-charset . cp866)))
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
382
18520
383d11185239 Swap args to define-coding-system-alias.
Richard M. Stallman <rms@gnu.org>
parents: 18454
diff changeset
383 (define-coding-system-alias 'alternativnyj 'cyrillic-alternativnyj)
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
384 (define-coding-system-alias 'cp866 'cyrillic-alternativnyj)
18308
b8622afb8a6e Don't make the keymap
Kenichi Handa <handa@m17n.org>
parents: 18203
diff changeset
385
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
386 (define-ccl-program ccl-encode-alternativnyj-font
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
387 `(0
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
388 (translate-character cyrillic-alternativnyj-encode-table r0 r1))
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
389 "CCL program to encode Cyrillic chars to Alternativnyj font.")
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
390
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
391 (add-to-list 'font-ccl-encoder-alist
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
392 '("alternativnyj" . ccl-encode-alternativnyj-font))
17085
4dafa5431293 Change coding system name koi8 to koi8-r.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
393
17993
73869115ae0a Most of setup-LANGUAGE-environment functions are
Kenichi Handa <handa@m17n.org>
parents: 17841
diff changeset
394 (set-language-info-alist
22983
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
395 "Cyrillic-ALT" `((charset cyrillic-iso8859-5)
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
396 (nonascii-translation
29453
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
397 . ,(get 'cyrillic-alternativnyj-nonascii-translation-table
22f8105a7dc7 Remove eval-when-compile.
Kenichi Handa <handa@m17n.org>
parents: 25827
diff changeset
398 'translation-table))
20745
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
399 (coding-system cyrillic-alternativnyj)
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
400 (coding-priority cyrillic-alternativnyj)
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
401 (input-method . "russian-typewriter")
22983
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
402 (features cyril-util)
7a010b8c0d99 ("LANUGAGE-ENVIRONMENT"): Delete property setup-function or change
Kenichi Handa <handa@m17n.org>
parents: 22881
diff changeset
403 (unibyte-display . cyrillic-alternativnyj)
19451
933bea774c3c Make describe-cyrillic-environment-map and
Kenichi Handa <handa@m17n.org>
parents: 18520
diff changeset
404 (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!")
20745
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
405 (documentation . "Support for Cyrillic ALTERNATIVNYJ."))
00aa1d4fa378 Remove setting up of
Kenichi Handa <handa@m17n.org>
parents: 20233
diff changeset
406 '("Cyrillic"))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
407
46500
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
408 (set-language-info-alist
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
409 "Windows-1251" `((coding-system windows-1251)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
410 (coding-priority windows-1251)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
411 (nonascii-translation
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
412 . ,(get 'decode-windows-1252 'translation-table))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
413 (input-method . "russian-typewriter") ; fixme?
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
414 (features code-pages)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
415 (documentation . "Support for windows-1251 character set."))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
416 '("Cyrillic"))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
417
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
418 (set-language-info-alist
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
419 "Tajik" `((coding-system cyrillic-koi8-t)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
420 (coding-priority cyrillic-koi8-t)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
421 (nonascii-translation
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
422 . ,(get 'decode-koi8-t 'translation-table))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
423 (input-method . "russian-typewriter") ; fixme?
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
424 (features code-pages)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
425 (documentation . "Support for Tajik using KOI8-T."))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
426 '("Cyrillic"))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
427
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
428 (set-language-info-alist
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
429 "Bulgarian" `((coding-system windows-1251)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
430 (coding-priority windows-1251)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
431 (nonascii-translation
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
432 . ,(get 'decode-windows-1251 'translation-table))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
433 (input-method . "bulgarian-standard")
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
434 (features code-pages)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
435 (documentation
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
436 . "Support for Bulgrian with windows-1251 character set."))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
437 '("Cyrillic"))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
438
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
439 (set-language-info-alist
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
440 "Belarusian" `((coding-system windows-1251)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
441 (coding-priority windows-1251)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
442 (nonascii-translation
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
443 . ,(get 'decode-windows-1251 'translation-table))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
444 (input-method . "belarusian")
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
445 (features code-pages)
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
446 (documentation
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
447 . "Support for Belarusian with windows-1251 character set.
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
448 \(The name Belarusian replaced Byelorussian in the early 1990s.)"))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
449 '("Cyrillic"))
81c9cd627d93 (cyrillic-koi8-r-decode-table)
Dave Love <fx@gnu.org>
parents: 45639
diff changeset
450
33778
6d966e8b4bbe Use provide.
Dave Love <fx@gnu.org>
parents: 30495
diff changeset
451 (provide 'cyrillic)
6d966e8b4bbe Use provide.
Dave Love <fx@gnu.org>
parents: 30495
diff changeset
452
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
453 ;;; cyrillic.el ends here