Function: make-translation-table-from-vector

make-translation-table-from-vector is a byte-compiled function defined in mule.el.gz.

Signature

(make-translation-table-from-vector VEC)

Documentation

Make translation table from decoding vector VEC.

VEC is an array of 256 elements to map unibyte codes to multibyte characters. Elements may be nil for undefined code points.

View in manual

Source Code

;; Defined in /usr/src/emacs/lisp/international/mule.el.gz
(defun make-translation-table-from-vector (vec)
  "Make translation table from decoding vector VEC.
VEC is an array of 256 elements to map unibyte codes to multibyte
characters.  Elements may be nil for undefined code points."
  (let ((table (make-char-table 'translation-table))
	(rev-table (make-char-table 'translation-table))
	ch)
    (dotimes (i 256)
      (setq ch (aref vec i))
      (when ch
	(aset table i ch)
	(if (>= ch 256)
	    (aset rev-table ch i))))
    (set-char-table-extra-slot table 0 rev-table)
    (set-char-table-extra-slot table 1 1)
    (set-char-table-extra-slot rev-table 1 1)
    table))