• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/language/

Lines Matching +defs:cyrillic +defs:koi8 +defs:encode +defs:table

0 ;;; cyrillic.el --- support for Cyrillic -*- coding: iso-2022-7bit; -*-
36 ;; <URL:http://czyborra.com/charsets/cyrillic.html>. The KOI and
45 ;; Alternativnyj coding systems encode both 8859-5 and Unicode.
46 ;; ucs-tables.el provides unification for cyrillic-iso-8bit.
50 ;; cyrillic-iso8859-5 characters take half as much space in the buffer
61 'cyrillic-iso-8bit 2 ?5
63 '(ascii cyrillic-iso8859-5 nil nil
65 '((safe-charsets ascii cyrillic-iso8859-5)
68 (define-coding-system-alias 'iso-8859-5 'cyrillic-iso-8bit)
71 "Cyrillic-ISO" '((charset cyrillic-iso8859-5)
72 (coding-system cyrillic-iso-8bit)
73 (coding-priority cyrillic-iso-8bit)
74 (input-method . "cyrillic-yawerty") ; fixme
75 (nonascii-translation . cyrillic-iso8859-5)
76 (unibyte-display . cyrillic-iso-8bit)
87 (defvar cyrillic-koi8-r-decode-table
116 "Cyrillic KOI8-R decoding table.")
118 (let ((table (make-translation-table-from-vector
119 cyrillic-koi8-r-decode-table)))
120 (define-translation-table 'cyrillic-koi8-r-nonascii-translation-table table)
121 (define-translation-table 'cyrillic-koi8-r-encode-table
122 (char-table-extra-slot table 0)))
126 (makunbound 'cyrillic-koi8-r-decode-table)
128 (define-ccl-program ccl-decode-koi8
135 ((translate-character cyrillic-koi8-r-nonascii-translation-table r0 r1)
136 (translate-character ucs-translation-table-for-decode r0 r1)
141 (define-ccl-program ccl-encode-koi8
145 (translate-character cyrillic-koi8-r-encode-table r0 r1)
151 "CCL program to encode KOI8-R.")
153 (defun cyrillic-unify-encoding (table)
155 This works whether or not the table is Unicode-based or
157 (let ((table (get table 'translation-table)))
159 (let* ((c (make-char 'cyrillic-iso8859-5 (+ i 32)))
165 (ec (aref table c)) ; encoding of 8859-5
166 (uc (aref table u))) ; encoding of Unicode
169 (aset table u ec))
171 (aset table c uc)))))))
173 (cyrillic-unify-encoding 'cyrillic-koi8-r-encode-table)
176 'cyrillic-koi8 4
179 ;; So people who use koi8 for languages other than Russian
182 '(ccl-decode-koi8 . ccl-encode-koi8)
183 `((safe-chars . cyrillic-koi8-r-encode-table)
184 (mime-charset . koi8-r)
188 (define-coding-system-alias 'koi8-r 'cyrillic-koi8)
189 (define-coding-system-alias 'koi8 'cyrillic-koi8)
190 (define-coding-system-alias 'cp878 'cyrillic-koi8)
192 (let ((elt `("koi8-r" koi8-r 1
193 ,(get 'cyrillic-koi8-r-encode-table 'translation-table)))
194 (slot (assoc "koi8-r" ctext-non-standard-encodings-alist)))
204 (define-ccl-program ccl-encode-8859-5-font
206 ((if (r0 == ,(charset-id 'cyrillic-iso8859-5))
212 (add-to-list 'font-ccl-encoder-alist '("iso8859-5" . ccl-encode-8859-5-font))
214 ;; The table is set up later to encode both Unicode and 8859-5.
215 (define-ccl-program ccl-encode-koi8-font
220 (translate-character cyrillic-koi8-r-encode-table r0 r1))
221 "CCL program to encode Cyrillic chars to KOI font.")
223 (add-to-list 'font-ccl-encoder-alist '("koi8" . ccl-encode-koi8-font))
226 "Cyrillic-KOI8" `((charset cyrillic-iso8859-5)
228 . ,(get 'cyrillic-koi8-r-nonascii-translation-table
229 'translation-table))
230 (coding-system cyrillic-koi8)
231 (coding-priority cyrillic-koi8 cyrillic-iso-8bit)
232 (ctext-non-standard-encodings "koi8-r")
235 (unibyte-display . cyrillic-koi8)
241 "Russian" `((charset cyrillic-iso8859-5)
243 . ,(get 'cyrillic-koi8-r-nonascii-translation-table
244 'translation-table))
245 (coding-system cyrillic-koi8)
246 (coding-priority cyrillic-koi8 cyrillic-iso-8bit)
249 (unibyte-display . cyrillic-koi8)
252 Support for Russian using koi8-r and the russian-computer input method.")
257 (defvar cyrillic-koi8-u-decode-table
286 "Cyrillic KOI8-U decoding table.")
288 (let ((table (make-translation-table-from-vector
289 cyrillic-koi8-u-decode-table)))
290 (define-translation-table 'cyrillic-koi8-u-nonascii-translation-table table)
291 (define-translation-table 'cyrillic-koi8-u-encode-table
292 (char-table-extra-slot table 0)))
294 (makunbound 'cyrillic-koi8-u-decode-table)
296 (define-ccl-program ccl-decode-koi8-u
303 ((translate-character cyrillic-koi8-u-nonascii-translation-table r0 r1)
304 (translate-character ucs-translation-table-for-decode r0 r1)
309 (define-ccl-program ccl-encode-koi8-u
313 (translate-character cyrillic-koi8-u-encode-table r0 r1)
319 "CCL program to encode KOI8-U.")
321 (cyrillic-unify-encoding 'cyrillic-koi8-u-encode-table)
324 'koi8-u 4
326 '(ccl-decode-koi8-u . ccl-encode-koi8-u)
327 `((safe-chars . cyrillic-koi8-u-encode-table)
328 (mime-charset . koi8-u)
332 (define-ccl-program ccl-encode-koi8-u-font
334 (translate-character cyrillic-koi8-u-encode-table r0 r1))
335 "CCL program to encode Cyrillic chars to KOI-U font.")
337 (add-to-list 'font-ccl-encoder-alist '("koi8-u" . ccl-encode-koi8-u-font))
340 "Ukrainian" `((coding-system koi8-u)
341 (coding-priority koi8-u)
343 . ,(get 'cyrillic-koi8-u-nonascii-translation-table
344 'translation-table))
352 ;; Fixme: It's unclear what's the correct table. I've found
355 (defvar cyrillic-alternativnyj-decode-table
381 ;; Taken from http://www.cyrillic.com/ref/cyrillic/koi-8alt.html
383 ;; table.
385 "Cyrillic ALTERNATIVNYJ decoding table.")
387 (let ((table (make-translation-table-from-vector
388 cyrillic-alternativnyj-decode-table)))
389 (define-translation-table 'cyrillic-alternativnyj-nonascii-translation-table
390 table)
391 (define-translation-table 'cyrillic-alternativnyj-encode-table
392 (char-table-extra-slot table 0)))
394 (makunbound 'cyrillic-alternativnyj-decode-table)
403 ((translate-character cyrillic-alternativnyj-nonascii-translation-table
405 (translate-character ucs-translation-table-for-decode r0 r1)
410 (define-ccl-program ccl-encode-alternativnyj
414 (translate-character cyrillic-alternativnyj-encode-table r0 r1)
420 "CCL program to encode Alternativnyj.")
422 (cyrillic-unify-encoding 'cyrillic-alternativnyj-encode-table)
425 'cyrillic-alternativnyj 4 ?A
427 '(ccl-decode-alternativnyj . ccl-encode-alternativnyj)
428 `((safe-chars . cyrillic-alternativnyj-encode-table)
432 (define-coding-system-alias 'alternativnyj 'cyrillic-alternativnyj)
434 (define-ccl-program ccl-encode-alternativnyj-font
436 (translate-character cyrillic-alternativnyj-encode-table r0 r1))
437 "CCL program to encode Cyrillic chars to Alternativnyj font.")
440 '("alternativnyj" . ccl-encode-alternativnyj-font))
443 "Cyrillic-ALT" `((charset cyrillic-iso8859-5)
445 . ,(get 'cyrillic-alternativnyj-nonascii-translation-table
446 'translation-table))
447 (coding-system cyrillic-alternativnyj)
448 (coding-priority cyrillic-alternativnyj)
451 (unibyte-display . cyrillic-alternativnyj)
457 "Tajik" `((coding-system cyrillic-koi8-t)
458 (coding-priority cyrillic-koi8-t)
460 . ,(get 'decode-koi8-t 'translation-table))
480 ;; Register cyrillic-iso8859-5 characters in the encode table of
482 (let ((table (get 'encode-windows-1251 'translation-table))
483 ;; Nth element is a cyrillic-iso8859-5 character encoded to a
495 (aset table (aref vec i) (+ 128 i)))))
500 ,(get 'encode-windows-1251 'translation-table)))
506 (define-ccl-program ccl-encode-windows-1251-font
511 (translate-character encode-windows-1251 r0 r1))))
514 '("microsoft-cp1251" . ccl-encode-windows-1251-font))
521 (,(get 'encode-windows-1251 'translation-table)
523 (,(get 'cyrillic-koi8-r-encode-table 'translation-table)
524 . (nil . "koi8-r")))
526 . ,(get 'decode-windows-1251 'translation-table))
538 (,(get 'encode-windows-1251 'translation-table)
540 (,(get 'cyrillic-koi8-r-encode-table 'translation-table)
541 . (nil . "koi8-r")))
543 . ,(get 'decode-windows-1251 'translation-table))
550 (provide 'cyrillic)
553 ;;; cyrillic.el ends here