--- /dev/null
+;;; ind-util.el --- Transliteration and Misc. Tools for Indian Languages -*- coding: iso-2022-7bit; -*-
+
+;; Copyright (C) 2001 Free Software Foundation, Inc.
+
+;; Maintainer: KAWABATA, Taichi <batta@beige.ocn.ne.jp>
+;; Keywords: multilingual, Indian, Devanagari
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; This file provides conversion between UCS and various
+;; transliteration schemes, such as ITRANS, kyoto-harvard and aiba
+;; methods. It also provides conversion between IS 13194 and UCS.
+;; Finally, this program provides the compatibility support with
+;; old implementation of Devanagari script.
+
+;;; Code:
+
+;;; Transliteration
+
+;; The followings provide the various transliteration schemes (such as
+;; ITRANS, kyoto-harvard, and Aiba) of Indian scripts. They are also
+;; used in quail/indian.el for typing Indian script in Emacs.
+
+(eval-and-compile
+(require 'cl)
+
+(defun range (from to)
+ "Make the list of the integers of range FROM to TO."
+ (let (result)
+ (while (<= from to) (setq result (cons to result) to (1- to))) result))
+
+(defun regexp-of-hashtbl-keys (hashtbl)
+ "Returns the regular expression of hashtable keys."
+ (let ((max-specpdl-size 1000))
+ (regexp-opt
+ (sort
+ (let (dummy)
+ (maphash (function (lambda (key val) (setq dummy (cons key dummy)))) hashtbl)
+ dummy)
+ (function (lambda (x y) (> (length x) (length y))))))))
+
+(defvar indian-dev-base-table
+ '(
+ (;; VOWELS (18)
+ (?\e$,15E\e(B nil) (?\e$,15F\e(B ?\e$,15~\e(B) (?\e$,15G\e(B ?\e$,15\7f\e(B) (?\e$,15H\e(B ?\e$,16 \e(B) (?\e$,15I\e(B ?\e$,16!\e(B) (?\e$,15J\e(B ?\e$,16"\e(B)
+ (?\e$,15K\e(B ?\e$,16#\e(B) (?\e$,15L\e(B ?\e$,16$\e(B) (?\e$,15M\e(B ?\e$,16%\e(B) (?\e$,15N\e(B ?\e$,16&\e(B) (?\e$,15O\e(B ?\e$,16'\e(B) (?\e$,15P\e(B ?\e$,16(\e(B)
+ (?\e$,15Q\e(B ?\e$,16)\e(B) (?\e$,15R\e(B ?\e$,16*\e(B) (?\e$,15S\e(B ?\e$,16+\e(B) (?\e$,15T\e(B ?\e$,16,\e(B) (?\e$,16@\e(B ?\e$,16B\e(B) (?\e$,16A\e(B ?\e$,16C\e(B))
+ (;; CONSONANTS (currently 42, including special cases)
+ ?\e$,15U\e(B ?\e$,15V\e(B ?\e$,15W\e(B ?\e$,15X\e(B ?\e$,15Y\e(B ;; GUTTRULS
+ ?\e$,15Z\e(B ?\e$,15[\e(B ?\e$,15\\e(B ?\e$,15]\e(B ?\e$,15^\e(B ;; PALATALS
+ ?\e$,15_\e(B ?\e$,15`\e(B ?\e$,15a\e(B ?\e$,15b\e(B ?\e$,15c\e(B ;; CEREBRALS
+ ?\e$,15d\e(B ?\e$,15e\e(B ?\e$,15f\e(B ?\e$,15g\e(B ?\e$,15h\e(B ?\e$,15i\e(B ;; DENTALS
+ ?\e$,15j\e(B ?\e$,15k\e(B ?\e$,15l\e(B ?\e$,15m\e(B ?\e$,15n\e(B ;; LABIALS
+ ?\e$,15o\e(B ?\e$,15p\e(B ?\e$,15q\e(B ?\e$,15r\e(B ?\e$,15s\e(B ?\e$,15t\e(B ?\e$,15u\e(B ;; SEMIVOWELS
+ ?\e$,15v\e(B ?\e$,15w\e(B ?\e$,15x\e(B ?\e$,15y\e(B ;; SIBILANTS
+ ?\e$,168\e(B ?\e$,169\e(B ?\e$,16:\e(B ?\e$,16;\e(B ?\e$,16<\e(B ?\e$,16=\e(B ?\e$,16>\e(B ?\e$,16?\e(B ;; NUKTAS
+ "\e$,15\6-5^\e(B" "\e$,15U6-5w\e(B")
+ (;; Misc Symbols (7)
+ ?\e$,15A\e(B ?\e$,15B\e(B ?\e$,15C\e(B ?\e$,15}\e(B ?\e$,16-\e(B ?\e$,160\e(B ?\e$,16D\e(B)
+ (;; Digits (10)
+ ?\e$,16F\e(B ?\e$,16G\e(B ?\e$,16H\e(B ?\e$,16I\e(B ?\e$,16J\e(B ?\e$,16K\e(B ?\e$,16L\e(B ?\e$,16M\e(B ?\e$,16N\e(B ?\e$,16O\e(B)
+ (;; Inscript-extra (4) (#, $, ^, *, ])
+ "\e$,16-5p\e(B" "\e$,15p6-\e(B" "\e$,15d6-5p\e(B" "\e$,15v6-5p\e(B" "\e$,15|\e(B")))
+
+(defvar indian-pnj-base-table nil)
+(defvar indian-ori-base-table nil)
+(defvar indian-bng-base-table nil)
+(defvar indian-asm-base-table nil)
+(defvar indian-tlg-base-table nil)
+(defvar indian-knd-base-table nil)
+(defvar indian-mlm-base-table nil)
+(defvar indian-tml-base-table nil)
+
+(defvar indian-base-table-to-language-alist
+ '((indian-dev-base-table . "Devanagari")
+ (indian-pnj-base-table . "Punjabi")
+ (indian-ori-base-table . "Oriya")
+ (indian-bng-base-table . "Bengali")
+ (indian-asm-base-table . "Assamese")
+ (indian-tlg-base-table . "Telugu")
+ (indian-knd-base-table . "Kannada")
+ (indian-mlm-base-table . "Malayalam")
+ (indian-tml-base-table . "Tamil")))
+
+(defvar indian-itrans-v5-table
+ '(;; for encode/decode
+ (;; vowels -- 18
+ "a" ("aa" "A") "i" ("ii" "I") "u" ("uu" "U")
+ ("RRi" "R^i") ("LLi" "L^i") (".c" "e.c") nil "e" "ai"
+ "o.c" nil "o" "au" ("RRI" "R^I") ("LLI" "L^I"))
+ (;; consonants -- 40
+ "k" "kh" "g" "gh" ("~N" "N^")
+ "ch" ("Ch" "chh") "j" "jh" ("~n" "JN")
+ "T" "Th" "D" "Dh" "N"
+ "t" "th" "d" "dh" "n" "nh"
+ "p" "ph" "b" "bh" "m"
+ "y" "r" "rh" "l" ("L" "ld") nil ("v" "w")
+ "sh" ("Sh" "shh") "s" "h"
+ "q" "K" "G" ("J" "z") ".D" ".Dh" "f" ("Y" "yh")
+ ("GY" "dny") "x")
+ (;; misc -- 7
+ ".N" (".n" "M") "H" ".a" ".h" ("AUM" "OM") "..")))
+
+(defvar indian-kyoto-harvard-table
+ '(;; for encode/decode
+ (;; vowel
+ "a" ("A" "aa") "i" ("I" "ii") "u" ("U" "uu")
+ "R" ("L" "lR") nil nil "e" "ai"
+ nil nil "o" "au" ("q" "RR" "Q") ("E" "LL" "lRR"))
+ (;; consonant
+ "k" "kh" "g" "gh" "G"
+ "c" "ch" "j" "jh" "J"
+ "T" "Th" "D" "Dh" "N"
+ "t" "th" "d" "dh" "n" nil
+ "p" "ph" "b" "bh" "m"
+ "y" "r" nil "l" "L" nil "v"
+ ("z" "Z") "S" "s" "h"
+ nil nil nil nil nil nil nil nil
+ nil nil)
+ (;; misc
+ nil "M" "H" "'" nil "." nil)))
+
+(defvar indian-harvard-table
+ '(;; for encode/decode
+ (;; vowel
+ "a" ("A" "aa") "i" ("I" "ii") "u" ("U" "uu")
+ "R" ("L" "lR") nil nil "e" "ai"
+ nil nil "o" "au" ("RR" "q" "Q") ("LL" "E" "lRR"))
+ (;; consonant
+ "k" "kh" "g" "gh" "G"
+ "c" "ch" "j" "jh" "J"
+ "T" "Th" "D" "Dh" "N"
+ "t" "th" "d" "dh" "n" nil
+ "p" "ph" "b" "bh" "m"
+ "y" "r" nil "l" "L" nil "v"
+ ("z" "Z") "S" "s" "h"
+ nil nil nil nil nil nil nil nil
+ nil nil)
+ (;; misc
+ nil "M" "H" "'" nil "." nil)))
+
+(defvar indian-tokyo-table
+ '(;; for encode/decode
+ (;; vowel
+ "a" ("A" "aa") "i" ("I" "ii") "u" ("U" "uu")
+ "R" ("L" "lR") nil nil "e" "ai"
+ nil nil "o" "au" ("Q" "RR" "q") ("E" "LL" "lRR"))
+ (;; consonant
+ "k" "kh" "g" "gh" "G"
+ "c" "ch" "j" "jh" "J"
+ "T" "Th" "D" "Dh" "N"
+ "t" "th" "d" "dh" "n" nil
+ "p" "ph" "b" "bh" "m"
+ "y" "r" nil "l" "L" nil "v"
+ ("Z" "z") "S" "s" "h"
+ nil nil nil nil nil nil nil nil
+ nil nil)
+ (;; misc
+ nil "M" "H" "'" nil "." nil)))
+
+(defvar indian-aiba-table
+ '(;; for encode/decode
+ (;; vowel
+ "a" "aa" "i" "ii" "u" "uu"
+ ".r" ".l" nil nil "e" "ai"
+ nil nil "o" "au" "~r" "~l")
+ (;; consonant
+ "k" "kh" "g" "gh" "^n"
+ "c" "ch" "j" "jh" "~n"
+ ".t" ".th" ".d" ".dh" ".n"
+ "t" "th" "d" "dh" "n" nil
+ "p" "ph" "b" "bh" "m"
+ "y" "r" nil "l" nil nil "v"
+ "^s" ".s" "s" "h"
+ nil nil nil nil nil nil nil nil
+ nil nil)
+ (;; misc
+ nil ".m" ".h" "'" nil "." nil)))
+
+(defun mapthread (function seq1 &rest seqrest)
+ "Apply FUNCTION to each element of SEQ1 and return result list.
+If there are several SEQRESTs, FUNCTION is called with that many
+arguments, with all possible combinations of these multiple SEQUENCES.
+Thus, if SEQ1 contains 3 elements and SEQ2 contains 5 elements, then
+FUNCTION will be called 15 times."
+ (if seqrest
+ (mapcar
+ (lambda (x)
+ (apply
+ 'mapthread
+ `(lambda (&rest y) (apply (quote ,function) ,x y))
+ seqrest))
+ seq1)
+ (mapcar function seq1)))
+
+(defun indian--puthash-char (char trans-char hashtbls)
+ (let ((encode-hash (car hashtbls)) ;; char -> trans
+ (decode-hash (cdr hashtbls)) ;; trans -> char
+ )
+ ;; char -- nil / char / string (/ list of vowel & matra)
+ ;; trans-char -- nil / string / list of strings
+ (when (and char trans-char)
+ (if (stringp trans-char) (setq trans-char (list trans-char)))
+ (if (char-valid-p char) (setq char (char-to-string char)))
+ (puthash char (car trans-char) encode-hash)
+ (mapc
+ '(lambda (trans)
+ (puthash trans char decode-hash))
+ trans-char))))
+
+(defun indian--puthash-v (v trans-v hashtbls)
+ (mapcar*
+ '(lambda (v trans-v)
+ (indian--puthash-char (car v) trans-v hashtbls))
+ v trans-v))
+
+(defun indian--puthash-c (c trans-c halant hashtbls)
+ (mapcar*
+ '(lambda (c trans-c)
+ (if (char-valid-p c) (setq c (char-to-string c)))
+ (indian--puthash-char (concat c halant) trans-c hashtbls))
+ c trans-c))
+
+(defun indian--puthash-m (m trans-m hashtbls)
+ (mapcar*
+ '(lambda (m trans-m)
+ (indian--puthash-char m trans-m hashtbls))
+ m trans-m))
+
+(defun indian--puthash-cv (c trans-c v trans-v hashtbls)
+ (mapcar*
+ '(lambda (c trans-c)
+ (mapcar*
+ (lambda (v trans-v)
+ (when (and c trans-c v trans-v)
+ (if (char-valid-p c) (setq c (char-to-string c)))
+ (setq v (if (char-valid-p (cadr v)) (char-to-string (cadr v)) ""))
+ (if (stringp trans-c) (setq trans-c (list trans-c)))
+ (if (stringp trans-v) (setq trans-v (list trans-v)))
+ (indian--puthash-char
+ (concat c v)
+ (apply 'append
+ (mapthread 'concat trans-c trans-v))
+ hashtbls)))
+ v trans-v))
+ c trans-c))
+
+(defun indian-make-hash (table trans-table)
+ "Indian Transliteration Hash for decode/encode"
+ (let* ((encode-hash (makehash 'equal))
+ (decode-hash (makehash 'equal))
+ (hashtbls (cons encode-hash decode-hash))
+ (vowels (elt table 0))
+ (consonants (elt table 1))
+ (misc (elt table 2))
+ (digits (elt table 3))
+ (halant (char-to-string (elt misc 4)))
+ (trans-vowels (elt trans-table 0))
+ (trans-consonants (elt trans-table 1))
+ (trans-misc (elt trans-table 2))
+ (trans-digits '("0" "1" "2" "3" "4" "5" "6" "7" "8" "9")))
+ (indian--puthash-v vowels trans-vowels hashtbls)
+ (indian--puthash-c consonants trans-consonants halant hashtbls)
+ (indian--puthash-cv consonants trans-consonants
+ vowels trans-vowels hashtbls)
+ (indian--puthash-m misc trans-misc hashtbls)
+ (indian--puthash-m digits trans-digits hashtbls)
+ hashtbls))
+
+(defvar indian-dev-itrans-v5-hash
+ (indian-make-hash indian-dev-base-table
+ indian-itrans-v5-table))
+(defvar indian-dev-kyoto-harvard-hash
+ (indian-make-hash indian-dev-base-table
+ indian-kyoto-harvard-table))
+(defvar indian-dev-aiba-hash
+ (indian-make-hash indian-dev-base-table
+ indian-aiba-table))
+
+)
+
+(defmacro indian-translate-region (from to hashtable encode-p)
+ `(save-excursion
+ (save-restriction
+ (let ((regexp ,(regexp-of-hashtbl-keys
+ (if encode-p (car (eval hashtable))
+ (cdr (eval hashtable))))))
+ (narrow-to-region from to)
+ (goto-char (point-min))
+ (while (re-search-forward regexp nil t)
+ (let ((matchstr (gethash (match-string 0)
+ (if ,encode-p (car ,hashtable) (cdr ,hashtable)))))
+ (if matchstr (replace-match matchstr))))))))
+
+;;;
+
+(defun indian-dev-itrans-v5-encode-region (from to)
+ (interactive "r")
+ (indian-translate-region
+ from to indian-dev-itrans-v5-hash t))
+
+(defun indian-dev-itrans-v5-decode-region (from to)
+ (interactive "r")
+ (indian-translate-region
+ from to indian-dev-itrans-v5-hash nil))
+
+(defun indian-dev-kyoto-harvard-encode-region (from to)
+ (interactive "r")
+ (indian-translate-region
+ from to indian-dev-kyoto-harvard-hash t))
+
+(defun indian-dev-kyoto-harvard-decode-region (from to)
+ (interactive "r")
+ (indian-translate-region
+ from to indian-dev-kyoto-harvard-hash nil))
+
+(defun indian-dev-aiba-encode-region (from to)
+ (interactive "r")
+ (indian-translate-region
+ from to indian-dev-aiba-hash t))
+
+(defun indian-dev-aiba-decode-region (from to)
+ (interactive "r")
+ (indian-translate-region
+ from to indian-dev-aiba-hash nil))
+
+
+
+
+;;; IS 13194 utilities
+
+;; The followings provide conversion between IS 13194 (ISCII) and UCS.
+
+(defvar ucs-devanagari-to-is13194-alist
+ '(;;Unicode vs IS13194 ;; only Devanagari is supported now.
+ (?\x0900 . "[U+0900]")
+ (?\x0901 . "\e(5!\e(B")
+ (?\x0902 . "\e(5"\e(B")
+ (?\x0903 . "\e(5#\e(B")
+ (?\x0904 . "[U+0904]")
+ (?\x0905 . "\e(5$\e(B")
+ (?\x0906 . "\e(5%\e(B")
+ (?\x0907 . "\e(5&\e(B")
+ (?\x0908 . "\e(5'\e(B")
+ (?\x0909 . "\e(5(\e(B")
+ (?\x090a . "\e(5)\e(B")
+ (?\x090b . "\e(5*\e(B")
+ (?\x090c . "\e(5&i\e(B")
+ (?\x090d . "\e(5.\e(B")
+ (?\x090e . "\e(5+\e(B")
+ (?\x090f . "\e(5,\e(B")
+ (?\x0910 . "\e(5-\e(B")
+ (?\x0911 . "\e(52\e(B")
+ (?\x0912 . "\e(5/\e(B")
+ (?\x0913 . "\e(50\e(B")
+ (?\x0914 . "\e(51\e(B")
+ (?\x0915 . "\e(53\e(B")
+ (?\x0916 . "\e(54\e(B")
+ (?\x0917 . "\e(55\e(B")
+ (?\x0918 . "\e(56\e(B")
+ (?\x0919 . "\e(57\e(B")
+ (?\x091a . "\e(58\e(B")
+ (?\x091b . "\e(59\e(B")
+ (?\x091c . "\e(5:\e(B")
+ (?\x091d . "\e(5;\e(B")
+ (?\x091e . "\e(5<\e(B")
+ (?\x091f . "\e(5=\e(B")
+ (?\x0920 . "\e(5>\e(B")
+ (?\x0921 . "\e(5?\e(B")
+ (?\x0922 . "\e(5@\e(B")
+ (?\x0923 . "\e(5A\e(B")
+ (?\x0924 . "\e(5B\e(B")
+ (?\x0925 . "\e(5C\e(B")
+ (?\x0926 . "\e(5D\e(B")
+ (?\x0927 . "\e(5E\e(B")
+ (?\x0928 . "\e(5F\e(B")
+ (?\x0929 . "\e(5G\e(B")
+ (?\x092a . "\e(5H\e(B")
+ (?\x092b . "\e(5I\e(B")
+ (?\x092c . "\e(5J\e(B")
+ (?\x092d . "\e(5K\e(B")
+ (?\x092e . "\e(5L\e(B")
+ (?\x092f . "\e(5M\e(B")
+ (?\x0930 . "\e(5O\e(B")
+ (?\x0931 . "\e(5P\e(B")
+ (?\x0932 . "\e(5Q\e(B")
+ (?\x0933 . "\e(5R\e(B")
+ (?\x0934 . "\e(5S\e(B")
+ (?\x0935 . "\e(5T\e(B")
+ (?\x0936 . "\e(5U\e(B")
+ (?\x0937 . "\e(5V\e(B")
+ (?\x0938 . "\e(5W\e(B")
+ (?\x0939 . "\e(5X\e(B")
+ (?\x093a . "[U+093a]")
+ (?\x093b . "[U+093b]")
+ (?\x093c . "\e(5i\e(B")
+ (?\x093d . "\e(5ji\e(B")
+ (?\x093e . "\e(5Z\e(B")
+ (?\x093f . "\e(5[\e(B")
+ (?\x0940 . "\e(5\\e(B")
+ (?\x0941 . "\e(5]\e(B")
+ (?\x0942 . "\e(5^\e(B")
+ (?\x0943 . "\e(5_\e(B")
+ (?\x0944 . "\e(5_i\e(B")
+ (?\x0945 . "\e(5c\e(B")
+ (?\x0946 . "\e(5`\e(B")
+ (?\x0947 . "\e(5a\e(B")
+ (?\x0948 . "\e(5b\e(B")
+ (?\x0949 . "\e(5g\e(B")
+ (?\x094a . "\e(5d\e(B")
+ (?\x094b . "\e(5e\e(B")
+ (?\x094c . "\e(5f\e(B")
+ (?\x094d . "\e(5h\e(B")
+ (?\x094e . "[U+094e]")
+ (?\x094f . "[U+094f]")
+ (?\x0950 . "\e(5!i\e(B")
+ (?\x0951 . "\e(5p5\e(B")
+ (?\x0952 . "\e(5p8\e(B")
+ (?\x0953 . "[DEVANAGARI GRAVE ACCENT]")
+ (?\x0954 . "[DEVANAGARI ACUTE ACCENT]")
+ (?\x0955 . "[U+0955]")
+ (?\x0956 . "[U+0956]")
+ (?\x0957 . "[U+0957]")
+ (?\x0958 . "\e(53i\e(B")
+ (?\x0959 . "\e(54i\e(B")
+ (?\x095a . "\e(55i\e(B")
+ (?\x095b . "\e(5:i\e(B")
+ (?\x095c . "\e(5?i\e(B")
+ (?\x095d . "\e(5@i\e(B")
+ (?\x095e . "\e(5Ii\e(B")
+ (?\x095f . "\e(5N\e(B")
+ (?\x0960 . "\e(5*i\e(B")
+ (?\x0961 . "\e(5'i\e(B")
+ (?\x0962 . "\e(5[i\e(B")
+ (?\x0963 . "\e(5ei\e(B")
+ (?\x0964 . "\e(5j\e(B")
+ (?\x0965 . "\e(5jj\e(B")
+ (?\x0966 . "\e(5q\e(B")
+ (?\x0967 . "\e(5r\e(B")
+ (?\x0968 . "\e(5s\e(B")
+ (?\x0969 . "\e(5t\e(B")
+ (?\x096a . "\e(5u\e(B")
+ (?\x096b . "\e(5v\e(B")
+ (?\x096c . "\e(5w\e(B")
+ (?\x096d . "\e(5x\e(B")
+ (?\x096e . "\e(5y\e(B")
+ (?\x096f . "\e(5z\e(B")
+ (?\x0970 . "[U+0970]")
+ (?\x0971 . "[U+0971]")
+ (?\x0972 . "[U+0972]")
+ (?\x0973 . "[U+0973]")
+ (?\x0974 . "[U+0974]")
+ (?\x0975 . "[U+0975]")
+ (?\x0976 . "[U+0976]")
+ (?\x0977 . "[U+0977]")
+ (?\x0978 . "[U+0978]")
+ (?\x0979 . "[U+0979]")
+ (?\x097a . "[U+097a]")
+ (?\x097b . "[U+097b]")
+ (?\x097c . "[U+097c]")
+ (?\x097d . "[U+097d]")
+ (?\x097e . "[U+097e]")
+ (?\x097f . "[U+097f]")))
+
+(defvar ucs-bengali-to-is13194-alist nil)
+(defvar ucs-assamese-to-is13194-alist nil)
+(defvar ucs-gurmukhi-to-is13194-alist nil)
+(defvar ucs-gujarati-to-is13194-alist nil)
+(defvar ucs-oriya-to-is13194-alist nil)
+(defvar ucs-tamil-to-is13194-alist nil)
+(defvar ucs-telugu-to-is13194-alist nil)
+(defvar ucs-malayalam-to-is13194-alist nil)
+
+(defvar is13194-default-repartory 'devanagari)
+
+(defvar is13194-repertory-to-ucs-script
+ `((DEF ?\x40 ,is13194-default-repartory)
+ (RMN ?\x41 ,is13194-default-repartory)
+ (DEV ?\x42 devanagari)
+ (BNG ?\x43 bengali)
+ (TML ?\x44 tamil)
+ (TLG ?\x45 telugu)
+ (ASM ?\x46 bengali)
+ (ORI ?\x47 oriya)
+ (KND ?\x48 kannada)
+ (MLM ?\x49 malayalam)
+ (GJR ?\x4a gujarati)
+ (PNJ ?\x4b gurmukhi)))
+
+;; for guiding find-variable function.
+(defvar is13194-to-ucs-devanagari-hashtbl nil)
+(defvar is13194-to-ucs-devanagari-regexp nil)
+(defvar is13194-to-ucs-bengali-hashtbl nil)
+(defvar is13194-to-ucs-bengali-regexp nil)
+(defvar is13194-to-ucs-assamese-hashtbl nil)
+(defvar is13194-to-ucs-assamese-regexp nil)
+(defvar is13194-to-ucs-gurmukhi-hashtbl nil)
+(defvar is13194-to-ucs-gurmukhi-regexp nil)
+(defvar is13194-to-ucs-gujarati-hashtbl nil)
+(defvar is13194-to-ucs-gujarati-regexp nil)
+(defvar is13194-to-ucs-oriya-hashtbl nil)
+(defvar is13194-to-ucs-oriya-regexp nil)
+(defvar is13194-to-ucs-tamil-hashtbl nil)
+(defvar is13194-to-ucs-tamil-regexp nil)
+(defvar is13194-to-ucs-telugu-hashtbl nil)
+(defvar is13194-to-ucs-telugu-regexp nil)
+(defvar is13194-to-ucs-malayalam-hashtbl nil)
+(defvar is13194-to-ucs-malayalam-regexp nil)
+
+(mapc
+ (function (lambda (script)
+ (let ((hashtable (intern (concat "is13194-to-ucs-"
+ (symbol-name script) "-hashtbl" )))
+ (regexp (intern (concat "is13194-to-ucs-"
+ (symbol-name script) "-regexp"))))
+ (set hashtable (make-hash-table :test 'equal :size 128))
+ (mapc
+ (function (lambda (x)
+ (put-char-code-property (decode-char 'ucs (car x))
+ 'script script)
+ (put-char-code-property (decode-char 'ucs (car x))
+ 'iscii (cdr x))
+ (puthash (cdr x) (char-to-string (decode-char 'ucs (car x)))
+ (eval hashtable))))
+ (eval (intern (concat "ucs-" (symbol-name script)
+ "-to-is13194-alist"))))
+ (set regexp (regexp-of-hashtbl-keys (eval hashtable))))))
+ '(devanagari bengali assamese gurmukhi gujarati
+ oriya tamil telugu malayalam))
+
+(defvar ucs-to-is13194-regexp
+ ;; only Devanagari is supported now.
+ (concat "[" (char-to-string (decode-char 'ucs #x0900))
+ "-" (char-to-string (decode-char 'ucs #x097f)) "]")
+ "Regexp that matches to conversion")
+
+(defun ucs-to-iscii-region (from to)
+ "Converts the indian UCS characters in the region to ISCII.
+Returns new end position."
+ (interactive "r")
+ ;; only Devanagari is supported now.
+ (save-excursion
+ (save-restriction
+ (narrow-to-region from to)
+ (goto-char (point-min))
+ (let* ((current-repertory is13194-default-repartory))
+ (while (re-search-forward ucs-to-is13194-regexp nil t)
+ (replace-match
+ (get-char-code-property (string-to-char (match-string 0))
+ 'iscii))))
+ (point-max))))
+
+(defun iscii-to-ucs-region (from to)
+ "Converts the ISCII characters in the region to UCS.
+Returns new end position."
+ (interactive "r")
+ ;; only Devanagari is supported now.
+ (save-excursion
+ (save-restriction
+ (narrow-to-region from to)
+ (goto-char (point-min))
+ (let* ((current-repertory is13194-default-repartory)
+ (current-hashtable
+ (intern (concat "is13194-to-ucs-"
+ (symbol-name current-repertory) "-hashtbl")))
+ (current-regexp
+ (intern (concat "is13194-to-ucs-"
+ (symbol-name current-repertory) "-regexp"))))
+ (while (re-search-forward (eval current-regexp) nil t)
+ (replace-match
+ (gethash (match-string 0) (eval current-hashtable) ""))))
+ (point-max))))
+
+;;;###autoload
+(defun indian-compose-region (from to)
+ "Compose the region according to `composition-function-table'. "
+ (interactive "r")
+ (save-excursion
+ (save-restriction
+ (let ((pos from) chars (max to))
+ (narrow-to-region from to)
+ (while (< pos max)
+ (setq chars (compose-chars-after pos))
+ (if chars (setq pos (+ pos chars)) (setq pos (1+ pos))))))))
+
+;;;###autoload
+(defun indian-compose-string (string)
+ (with-temp-buffer
+ (insert string)
+ (indian-compose-region (point-min) (point-max))
+ (buffer-string)))
+
+;;;###autoload
+(defun in-is13194-post-read-conversion (len)
+ (let ((pos (point)) endpos)
+ (setq endpos (iscii-to-ucs-region pos (+ pos len)))
+ (indian-compose-region pos endpos)
+ (- endpos pos)))
+
+;;;###autoload
+(defun in-is13194-pre-write-conversion (from to)
+ (let ((buf (current-buffer)))
+ (set-buffer (generate-new-buffer " *temp*"))
+ (if (stringp from)
+ (insert from)
+ (insert-buffer-substring buf from to))
+ (ucs-to-iscii-region (point-min) (point-max))
+ nil))
+
+
+
+
+;;; Backward Compatibility support programs
+
+;; The followings provides the conversion from old-implementation of
+;; Emacs Devanagari script to UCS.
+
+(defconst indian-2-colum-to-ucs
+ '(
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2120 \e$(5!!!"!#!$!%!&!'!(!)!*!+!,!-!.!/\e(B
+ ("\e$(5!!\e(B" . "\e$,15A\e(B")
+ ("\e$(5!"\e(B" . "\e$,15B\e(B")
+ ("\e$(5!#\e(B" . "\e$,15C\e(B")
+ ("\e$(5!$\e(B" . "\e$,15E\e(B")
+ ("\e$(5!%\e(B" . "\e$,15F\e(B")
+ ("\e$(5!&\e(B" . "\e$,15G\e(B")
+ ("\e$(5!'\e(B" . "\e$,15H\e(B")
+ ("\e$(5!(\e(B" . "\e$,15I\e(B")
+ ("\e$(5!)\e(B" . "\e$,15J\e(B")
+ ("\e$(5!*\e(B" . "\e$,15K\e(B")
+ ("\e$(5!*"p\e(B" . "\e$,15p6#\e(B")
+ ("\e$(5!+\e(B" . "\e$,15N\e(B")
+ ("\e$(5!,\e(B" . "\e$,15O\e(B")
+ ("\e$(5!-\e(B" . "\e$,15P\e(B")
+ ("\e$(5!.\e(B" . "\e$,15M\e(B")
+ ("\e$(5!/\e(B" . "\e$,15R\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2130 \e$(5!0!1!2!3!4!5!6!7!8!9!:!;!<!=!>!?\e(B
+ ("\e$(5!0\e(B" . "\e$,15S\e(B")
+ ("\e$(5!1\e(B" . "\e$,15T\e(B")
+ ("\e$(5!2\e(B" . "\e$,15Q\e(B")
+ ("\e$(5!3\e(B" . "\e$,15U\e(B")
+ ("\e$(5!4\e(B" . "\e$,15V\e(B")
+ ("\e$(5!5\e(B" . "\e$,15W\e(B")
+ ("\e$(5!6\e(B" . "\e$,15X\e(B")
+ ("\e$(5!7\e(B" . "\e$,15Y\e(B")
+ ("\e$(5!8\e(B" . "\e$,15Z\e(B")
+ ("\e$(5!9\e(B" . "\e$,15[\e(B")
+ ("\e$(5!:\e(B" . "\e$,15\\e(B")
+ ("\e$(5!;\e(B" . "\e$,15]\e(B")
+ ("\e$(5!<\e(B" . "\e$,15^\e(B")
+ ("\e$(5!=\e(B" . "\e$,15_\e(B")
+ ("\e$(5!>\e(B" . "\e$,15`\e(B")
+ ("\e$(5!?\e(B" . "\e$,15a\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2140 \e$(5!@!A!B!C!D!E!F!G!H!I!J!K!L!M!N!O\e(B
+ ("\e$(5!@\e(B" . "\e$,15b\e(B")
+ ("\e$(5!A\e(B" . "\e$,15c\e(B")
+ ("\e$(5!B\e(B" . "\e$,15d\e(B")
+ ("\e$(5!C\e(B" . "\e$,15e\e(B")
+ ("\e$(5!D\e(B" . "\e$,15f\e(B")
+ ("\e$(5!E\e(B" . "\e$,15g\e(B")
+ ("\e$(5!F\e(B" . "\e$,15h\e(B")
+ ("\e$(5!G\e(B" . "\e$,15i\e(B")
+ ("\e$(5!H\e(B" . "\e$,15j\e(B")
+ ("\e$(5!I\e(B" . "\e$,15k\e(B")
+ ("\e$(5!J\e(B" . "\e$,15l\e(B")
+ ("\e$(5!K\e(B" . "\e$,15m\e(B")
+ ("\e$(5!L\e(B" . "\e$,15n\e(B")
+ ("\e$(5!M\e(B" . "\e$,15o\e(B")
+ ("\e$(5!N\e(B" . "\e$,16?\e(B")
+ ("\e$(5!O\e(B" . "\e$,15p\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2150 \e$(5!P!Q!R!S!T!U!V!W!X!Y!Z![!\!]!^!_\e(B
+ ("\e$(5!P\e(B" . "\e$,15q\e(B")
+ ("\e$(5!Q\e(B" . "\e$,15r\e(B")
+ ("\e$(5!R\e(B" . "\e$,15s\e(B")
+ ("\e$(5!S\e(B" . "\e$,15t\e(B")
+ ("\e$(5!T\e(B" . "\e$,15u\e(B")
+ ("\e$(5!U\e(B" . "\e$,15v\e(B")
+ ("\e$(5!V\e(B" . "\e$,15w\e(B")
+ ("\e$(5!W\e(B" . "\e$,15x\e(B")
+ ("\e$(5!X\e(B" . "\e$,15y\e(B")
+ ("\e$(5!Z\e(B" . "\e$,15~\e(B")
+ ("\e$(5![\e(B" . "\e$,15\7f\e(B")
+ ("\e$(5!\\e(B" . "\e$,16 \e(B")
+ ("\e$(5!]\e(B" . "\e$,16!\e(B")
+ ("\e$(5!^\e(B" . "\e$,16"\e(B")
+ ("\e$(5!_\e(B" . "\e$,16#\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2160 \e$(5!`!a!b!c!d!e!f!g!h!i!j!k!l!m!n!o\e(B
+ ("\e$(5!`\e(B" . "\e$,16&\e(B")
+ ("\e$(5!a\e(B" . "\e$,16'\e(B")
+ ("\e$(5!b\e(B" . "\e$,16(\e(B")
+ ("\e$(5!c\e(B" . "\e$,16%\e(B")
+ ("\e$(5!d\e(B" . "\e$,16*\e(B")
+ ("\e$(5!e\e(B" . "\e$,16+\e(B")
+ ("\e$(5!f\e(B" . "\e$,16,\e(B")
+ ("\e$(5!g\e(B" . "\e$,16)\e(B")
+ ("\e$(5!h\e(B" . "\e$,16-\e(B")
+ ("\e$(5!i\e(B" . "\e$,15|\e(B")
+ ("\e$(5!j\e(B" . "\e$,16D\e(B")
+ ("\e$(5!j!j\e(B" . "\e$,16E\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2170 \e$(5!p!q!r!s!t!u!v!w!x!y!z!{!|!}!~\e(B
+ ("\e$(5!q\e(B" . "\e$,16F\e(B")
+ ("\e$(5!r\e(B" . "\e$,16G\e(B")
+ ("\e$(5!s\e(B" . "\e$,16H\e(B")
+ ("\e$(5!t\e(B" . "\e$,16I\e(B")
+ ("\e$(5!u\e(B" . "\e$,16J\e(B")
+ ("\e$(5!v\e(B" . "\e$,16K\e(B")
+ ("\e$(5!w\e(B" . "\e$,16L\e(B")
+ ("\e$(5!x\e(B" . "\e$,16M\e(B")
+ ("\e$(5!y\e(B" . "\e$,16N\e(B")
+ ("\e$(5!z\e(B" . "\e$,16O\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2220 \e$(5"!"""#"$"%"&"'"(")"*"+","-"."/\e(B
+ ("\e$(5"!\e(B" . "\e$,16;6-5p\e(B")
+ ("\e$(5""\e(B" . "\e$,16>6-5p\e(B")
+ ("\e$(5"#\e(B" . "\e$,15U6-5p\e(B")
+ ("\e$(5"$\e(B" . "\e$,15W6-5p\e(B")
+ ("\e$(5"%\e(B" . "\e$,15d6-5p\e(B")
+ ("\e$(5"&\e(B" . "\e$,15j6-5p\e(B")
+ ("\e$(5"'\e(B" . "\e$,15k6-5p\e(B")
+ ("\e$(5")\e(B" . "\e$,15v6-5p\e(B")
+ ("\e$(5",\e(B" . "\e$,15p6!\e(B")
+ ("\e$(5"-\e(B" . "\e$,15p6"\e(B")
+ ("\e$(5".\e(B" . "\e$,15q6!\e(B")
+ ("\e$(5"/\e(B" . "\e$,15q6"\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2230 \e$(5"0"1"2"3"4"5"6"7"8"9":";"<"=">"?\e(B
+ ("\e$(5"3\e(B" . "\e$,15U6-\e(B")
+ ("\e$(5"4\e(B" . "\e$,15V6-\e(B")
+ ("\e$(5"5\e(B" . "\e$,15W6-\e(B")
+ ("\e$(5"6\e(B" . "\e$,15X6-\e(B")
+ ("\e$(5"8\e(B" . "\e$,15Z6-\e(B")
+ ("\e$(5"8"q\e(B" . "\e$,15Z6-5p6-\e(B")
+ ("\e$(5":\e(B" . "\e$,15\6-\e(B")
+ ("\e$(5";\e(B" . "\e$,15]6-\e(B")
+ ("\e$(5"<\e(B" . "\e$,15^6-\e(B")
+ ("\e$(5"<\e(B" . "\e$,15^6-\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2240 \e$(5"@"A"B"C"D"E"F"G"H"I"J"K"L"M"N"O\e(B
+ ("\e$(5"A\e(B" . "\e$,15c6-\e(B")
+ ("\e$(5"B\e(B" . "\e$,15d6-\e(B")
+ ("\e$(5"C\e(B" . "\e$,15e6-\e(B")
+ ("\e$(5"E\e(B" . "\e$,15g6-\e(B")
+ ("\e$(5"F\e(B" . "\e$,15h6-\e(B")
+ ("\e$(5"G\e(B" . "\e$,15i6-\e(B")
+ ("\e$(5"H\e(B" . "\e$,15j6-\e(B")
+ ("\e$(5"I\e(B" . "\e$,15k6-\e(B")
+ ("\e$(5"J\e(B" . "\e$,15l6-\e(B")
+ ("\e$(5"J\e(B" . "\e$,15l6-\e(B")
+ ("\e$(5"K\e(B" . "\e$,15m6-\e(B")
+ ("\e$(5"L\e(B" . "\e$,15n6-\e(B")
+ ("\e$(5"M\e(B" . "\e$,15o6-\e(B")
+ ("\e$(5"N\e(B" . "\e$,16?6-\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2250 \e$(5"P"Q"R"S"T"U"V"W"X"Y"Z"["\"]"^"_\e(B
+ ("\e$(5"Q\e(B" . "\e$,15r6-\e(B")
+ ("\e$(5"R\e(B" . "\e$,15s6-\e(B")
+ ("\e$(5"S\e(B" . "\e$,15t6-\e(B")
+ ("\e$(5"T\e(B" . "\e$,15u6-\e(B")
+ ("\e$(5"U\e(B" . "\e$,15v6-\e(B")
+ ("\e$(5"V\e(B" . "\e$,15w6-\e(B")
+ ("\e$(5"W\e(B" . "\e$,15x6-\e(B")
+ ("\e$(5"]\e(B" . "\e$,16-5o\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2260 \e$(5"`"a"b"c"d"e"f"g"h"i"j"k"l"m"n"o\e(B
+ ("\e$(5"`\e(B" . "\e$,15W6-5p6-\e(B")
+ ("\e$(5"a\e(B" . "\e$,15X6-5h6-\e(B")
+ ("\e$(5"c\e(B" . "\e$,15d6-5d6-\e(B")
+ ("\e$(5"d\e(B" . "\e$,15d6-5p6-\e(B")
+ ("\e$(5"e\e(B" . "\e$,15g6-5h6-\e(B")
+ ("\e$(5"f\e(B" . "\e$,15g6-5p6-\e(B")
+ ("\e$(5"g\e(B" . "\e$,15j6-5d6-\e(B")
+ ("\e$(5"h\e(B" . "\e$,15v6-5Z6-\e(B")
+ ("\e$(5"i\e(B" . "\e$,15v6-5p6-\e(B")
+ ("\e$(5"j\e(B" . "\e$,15v6-5u6-\e(B")
+ ("\e$(5"k\e(B" . "\e$,15h6-5h6-\e(B")
+ ("\e$(5"l\e(B" . "\e$,15U6-5w6-\e(B")
+ ("\e$(5"m\e(B" . "\e$,15\6-5^6-\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2270 \e$(5"p"q"r"s"t"u"v"w"x"y"z"{"|"}"~\e(B
+ ("\e$(5"p\e(B" . "\e$,15p6-\e(B")
+ ("\e$(5"q\e(B" . "\e$,16-5p\e(B")
+ ("\e$(5"r\e(B" . "\e$,16-5p\e(B")
+ ("\e$(5"s\e(B" . "\e$,1686-\e(B")
+ ("\e$(5"t\e(B" . "\e$,1696-\e(B")
+ ("\e$(5"u\e(B" . "\e$,16:6-\e(B")
+ ("\e$(5"y\e(B" . "\e$,16>6-\e(B")
+ ("\e$(5"z\e(B" . "\e$,16;6-\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2320 \e$(5#!#"###$#%#&#'#(#)#*#+#,#-#.#/\e(B
+ ("\e$(5#!\e(B" . "\e$,160\e(B")
+ ("\e$(5#&\e(B" . "\e$,15L\e(B")
+ ("\e$(5#&"p\e(B" . "\e$,15p6$\e(B")
+ ("\e$(5#'\e(B" . "\e$,16A\e(B")
+ ("\e$(5#'"p\e(B" . "\e$,15p6C\e(B")
+ ("\e$(5#*\e(B" . "\e$,16@\e(B")
+ ("\e$(5#*"p\e(B" . "\e$,15p6B\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2330 \e$(5#0#1#2#3#4#5#6#7#8#9#:#;#<#=#>#?\e(B
+ ("\e$(5#3\e(B" . "\e$,168\e(B")
+ ("\e$(5#4\e(B" . "\e$,169\e(B")
+ ("\e$(5#5\e(B" . "\e$,16:\e(B")
+ ("\e$(5#:\e(B" . "\e$,16;\e(B")
+ ("\e$(5#?\e(B" . "\e$,16<\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2340 \e$(5#@#A#B#C#D#E#F#G#H#I#J#K#L#M#N#O\e(B
+ ("\e$(5#@\e(B" . "\e$,16=\e(B")
+ ("\e$(5#I\e(B" . "\e$,16>\e(B")
+ ("\e$(5#J\e(B" . "\e$,15}\e(B")
+ ("\e$(5#K\e(B" . "\e$,16$\e(B")
+ ("\e$(5#L\e(B" . "\e$,16B\e(B")
+ ("\e$(5#M\e(B" . "\e$,16C\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2350 \e$(5#P#Q#R#S#T#U#V#W#X#Y#Z#[#\#]#^#_\e(B
+ ("\e$(5#P\e(B" . "\e$,15n6-5h\e(B")
+ ("\e$(5#Q\e(B" . "\e$,15n6-5r\e(B")
+ ("\e$(5#R\e(B" . "\e$,15y6#\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2360 \e$(5#`#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o\e(B
+ ("\e$(5#`\e(B" . "\e$,15r6-5r\e(B")
+ ("\e$(5#a\e(B" . "\e$,15u6-5h\e(B")
+ ("\e$(5#b\e(B" . "\e$,15u6-5u\e(B")
+ ("\e$(5#c\e(B" . "\e$,15v6-5Z\e(B")
+ ("\e$(5#d\e(B" . "\e$,15v6-5h\e(B")
+ ("\e$(5#e\e(B" . "\e$,15v6-5l\e(B")
+ ("\e$(5#f\e(B" . "\e$,15v6-5r\e(B")
+ ("\e$(5#g\e(B" . "\e$,15v6-5u\e(B")
+ ("\e$(5#h\e(B" . "\e$,15w6-5_6-5p6-5o\e(B")
+ ("\e$(5#i\e(B" . "\e$,15w6-5_6-5o\e(B")
+ ("\e$(5#j\e(B" . "\e$,15w6-5_6-5u\e(B")
+ ("\e$(5#k\e(B" . "\e$,15w6-5_\e(B")
+ ("\e$(5#l\e(B" . "\e$,15w6-5`\e(B")
+ ("\e$(5#m\e(B" . "\e$,15x6-5h\e(B")
+ ("\e$(5#n\e(B" . "\e$,15x6-5p\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2370 \e$(5#p#q#r#s#t#u#v#w#x#y#z#{#|#}#~\e(B
+ ("\e$(5#p\e(B" . "\e$,15y6-5c\e(B")
+ ("\e$(5#q\e(B" . "\e$,15y6-5h\e(B")
+ ("\e$(5#r\e(B" . "\e$,15y6-5n\e(B")
+ ("\e$(5#s\e(B" . "\e$,15y6-5o\e(B")
+ ("\e$(5#t\e(B" . "\e$,15y6-5p\e(B")
+ ("\e$(5#u\e(B" . "\e$,15y6-5r\e(B")
+ ("\e$(5#v\e(B" . "\e$,15y6-5u\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2420 \e$(5$!$"$#$$$%$&$'$($)$*$+$,$-$.$/\e(B
+ ("\e$(5$!\e(B" . "\e$,15U6-5d6-5p6-5o\e(B")
+ ("\e$(5$"\e(B" . "\e$,15U6-5d6-5u\e(B")
+ ("\e$(5$#\e(B" . "\e$,15U6-5d6-5o\e(B")
+ ("\e$(5$$\e(B" . "\e$,15U6-5h6-5o\e(B")
+ ("\e$(5$%\e(B" . "\e$,15U6-5p6-5o\e(B")
+ ("\e$(5$&\e(B" . "\e$,15U6-5u6-5o\e(B")
+ ("\e$(5$'\e(B" . "\e$,15U6-5U\e(B")
+ ("\e$(5$(\e(B" . "\e$,15U6-5d\e(B")
+ ("\e$(5$)\e(B" . "\e$,15U6-5h\e(B")
+ ("\e$(5$*\e(B" . "\e$,15U6-5n\e(B")
+ ("\e$(5$+\e(B" . "\e$,15U6-5o\e(B")
+ ("\e$(5$,\e(B" . "\e$,15U6-5r\e(B")
+ ("\e$(5$-\e(B" . "\e$,15U6-5u\e(B")
+ ("\e$(5$.\e(B" . "\e$,15U6-5w\e(B")
+ ("\e$(5$/\e(B" . "\e$,15X6-5h\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2430 \e$(5$0$1$2$3$4$5$6$7$8$9$:$;$<$=$>$?\e(B
+ ("\e$(5$0\e(B" . "\e$,15Y6-5U6-5d6-5o\e(B")
+ ("\e$(5$1\e(B" . "\e$,15Y6-5U6-5w6-5u\e(B")
+ ("\e$(5$2\e(B" . "\e$,15Y6-5U6-5d\e(B")
+ ("\e$(5$3\e(B" . "\e$,15Y6-5U6-5w\e(B")
+ ("\e$(5$4\e(B" . "\e$,15Y6-5X6-5p\e(B")
+ ("\e$(5$5\e(B" . "\e$,15Y6-5U6-5o\e(B")
+ ("\e$(5$6\e(B" . "\e$,15Y6-5V6-5o\e(B")
+ ("\e$(5$7\e(B" . "\e$,15Y6-5W6-5o\e(B")
+ ("\e$(5$8\e(B" . "\e$,15Y6-5X6-5o\e(B")
+ ("\e$(5$9\e(B" . "\e$,15Y6-5U\e(B")
+ ("\e$(5$:\e(B" . "\e$,15Y6-5V\e(B")
+ ("\e$(5$;\e(B" . "\e$,15Y6-5W\e(B")
+ ("\e$(5$<\e(B" . "\e$,15Y6-5X\e(B")
+ ("\e$(5$=\e(B" . "\e$,15Y6-5Y\e(B")
+ ("\e$(5$>\e(B" . "\e$,15Y6-5h\e(B")
+ ("\e$(5$?\e(B" . "\e$,15Y6-5n\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2440 \e$(5$@$A$B$C$D$E$F$G$H$I$J$K$L$M$N$O\e(B
+ ("\e$(5$@\e(B" . "\e$,15Y6-5o\e(B")
+ ("\e$(5$A\e(B" . "\e$,15Z6-5Z\e(B")
+ ("\e$(5$B\e(B" . "\e$,15Z6-5^\e(B")
+ ("\e$(5$C\e(B" . "\e$,15[6-5o\e(B")
+ ("\e$(5$D\e(B" . "\e$,15\6-5p\e(B")
+ ("\e$(5$E\e(B" . "\e$,15\6-5^\e(B")
+ ("\e$(5$F\e(B" . "\e$,15^6-5Z\e(B")
+ ("\e$(5$G\e(B" . "\e$,15^6-5\\e(B")
+ ("\e$(5$H\e(B" . "\e$,15_6-5U\e(B")
+ ("\e$(5$I\e(B" . "\e$,15_6-5_\e(B")
+ ("\e$(5$J\e(B" . "\e$,15_6-5`\e(B")
+ ("\e$(5$K\e(B" . "\e$,15_6-5o\e(B")
+ ("\e$(5$L\e(B" . "\e$,15`6-5o\e(B")
+ ("\e$(5$M\e(B" . "\e$,15a6-5W6-5o\e(B")
+ ("\e$(5$N\e(B" . "\e$,15a6-5X6-5p\e(B")
+ ("\e$(5$O\e(B" . "\e$,15a6-5p6-5o\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2450 \e$(5$P$Q$R$S$T$U$V$W$X$Y$Z$[$\$]$^$_\e(B
+ ("\e$(5$P\e(B" . "\e$,15a6-5W\e(B")
+ ("\e$(5$Q\e(B" . "\e$,15a6-5X\e(B")
+ ("\e$(5$R\e(B" . "\e$,15a6-5a\e(B")
+ ("\e$(5$S\e(B" . "\e$,15a6-5n\e(B")
+ ("\e$(5$T\e(B" . "\e$,15a6-5o\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2460 \e$(5$`$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o\e(B
+ ("\e$(5$`\e(B" . "\e$,15b6-5o\e(B")
+ ("\e$(5$a\e(B" . "\e$,15d6-5d\e(B")
+ ("\e$(5$b\e(B" . "\e$,15d6-5h\e(B")
+ ("\e$(5$c\e(B" . "\e$,15f6-5f6-5o\e(B")
+ ("\e$(5$d\e(B" . "\e$,15f6-5g6-5o\e(B")
+ ("\e$(5$e\e(B" . "\e$,15f6-5m6-5o\e(B")
+ ("\e$(5$f\e(B" . "\e$,15f6-5p6-5o\e(B")
+ ("\e$(5$g\e(B" . "\e$,15f6-5u6-5o\e(B")
+ ("\e$(5$h\e(B" . "\e$,15f6-5W6-5p\e(B")
+ ("\e$(5$i\e(B" . "\e$,15f6-5X6-5p\e(B")
+ ("\e$(5$j\e(B" . "\e$,15f6-5f6-5u\e(B")
+ ("\e$(5$k\e(B" . "\e$,15f6-5g6-5u\e(B")
+ ("\e$(5$l\e(B" . "\e$,15f6-5W\e(B")
+ ("\e$(5$m\e(B" . "\e$,15f6-5X\e(B")
+ ("\e$(5$n\e(B" . "\e$,15f6-5f\e(B")
+ ("\e$(5$o\e(B" . "\e$,15f6-5g\e(B")
+ ;; 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ ;;2470 \e$(5$p$q$r$s$t$u$v$w$x$y$z${$|$}$~\e(B
+ ("\e$(5$p\e(B" . "\e$,15f6-5h\e(B")
+ ("\e$(5$q\e(B" . "\e$,15f6-5l\e(B")
+ ("\e$(5$r\e(B" . "\e$,15f6-5m\e(B")
+ ("\e$(5$s\e(B" . "\e$,15f6-5n\e(B")
+ ("\e$(5$t\e(B" . "\e$,15f6-5o\e(B")
+ ("\e$(5$u\e(B" . "\e$,15f6-5u\e(B")
+ ("\e$(5$v\e(B" . "\e$,15g6-5h\e(B")
+ ("\e$(5$w\e(B" . "\e$,15h6-5h\e(B")
+ ("\e$(5$x\e(B" . "\e$,15j6-5d\e(B")
+ ("\e$(5$y\e(B" . "\e$,15j6-5h\e(B")
+ ("\e$(5$z\e(B" . "\e$,15j6-5r\e(B")
+ ("\e$(5${\e(B" . "\e$,15l6-5h\e(B")
+ ("\e$(5$|\e(B" . "\e$,15l6-5l\e(B")
+ ("\e$(5$}\e(B" . "\e$,15l6-5u\e(B")
+ ("\e$(5$~\e(B" . "\e$,15m6-5h\e(B")))
+
+(defconst indian-2-column-to-ucs-regexp
+ "\e$(5!j!j\e(B\\|\e$(5"8"q\e(B\\|[\e$(5#&#'!*#*\e(B]\e$(5"p\e(B\\|[\e$(5!!\e(B-\e$(5$~\e(B]")
+
+(put 'indian-2-column-to-ucs-chartable 'char-table-extra-slots 1)
+(defconst indian-2-column-to-ucs-chartable
+ (let ((table (make-char-table 'indian-2-column-to-ucs-chartable))
+ (alist nil))
+ (dolist (elt indian-2-colum-to-ucs)
+ (if (= (length (car elt)) 1)
+ (aset table (aref (car elt) 0) (cdr elt))
+ (setq alist (cons elt alist))))
+ (set-char-table-extra-slot table 0 alist)
+ table))
+
+(defun indian-2-column-to-ucs-region (from to)
+ "Convert old Emacs Devanagari characters to UCS."
+ (interactive "r")
+ (save-excursion
+ (save-restriction
+ (let ((pos from)
+ (alist (char-table-extra-slot indian-2-column-to-ucs-chartable 0)))
+ (narrow-to-region from to)
+ (decompose-region from to)
+ (goto-char (point-min))
+ (while (re-search-forward indian-2-column-to-ucs-regexp nil t)
+ (let ((len (- (match-end 0) (match-beginning 0)))
+ subst)
+ (if (= len 1)
+ (setq subst (aref indian-2-column-to-ucs-chartable (char-after (match-beginning 0))))
+ (setq subst (assoc (match-string 0) alist)))
+ (replace-match (if subst subst "?"))))
+ (indian-compose-region (point-min) (point-max))))))
+
+(provide 'ind-util)
+
+;;; ind-util.el ends here