X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Futf-2000%2Fread-maps.el;h=f7d9541f996872f60f09dce7b95e06a1b49a4b10;hb=bcf600a1554a3415af49e95f8454b97dca922aca;hp=739818df2f93c3513dd3981c39341fc04358aeec;hpb=4089c0ad94fb93e9e6a7c8532deb3b341437b95d;p=chise%2Fxemacs-chise.git.1 diff --git a/lisp/utf-2000/read-maps.el b/lisp/utf-2000/read-maps.el index 739818d..f7d9541 100644 --- a/lisp/utf-2000/read-maps.el +++ b/lisp/utf-2000/read-maps.el @@ -1,6 +1,6 @@ ;;; read-maps.el --- Read mapping-tables. -;; Copyright (C) 2002,2003,2004 MORIOKA Tomohiko +;; Copyright (C) 2002,2003,2004,2005,2006,2008 MORIOKA Tomohiko ;; Author: MORIOKA Tomohiko ;; Keywords: mapping table, character, CCS, multiscript, multilingual @@ -27,7 +27,7 @@ (defvar mapping-table-ccs-setting-alist '((=jis-x0208@1990 "^J90-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\)" 1 16 - =ucs@jis + =ucs@jis/1990 "\tJU[+-]\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]+\\)") (=jis-x0212 "^JSP-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\)" 1 16 @@ -41,6 +41,10 @@ "^JX2-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\)" 1 16 =ucs@jis/2000 "\tJU[+-]\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]+\\)") + (=gb2312 + "^G0-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\)" 1 16 + =ucs@gb + "\tGU[+-]\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]+\\)") (=cns11643-1 "^C1-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\)" 1 16 =ucs@cns @@ -53,14 +57,26 @@ "^C3-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\)" 1 16 =ucs@cns "\tCU[+-]\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]+\\)") - (=cns11643-4 + (=cns11643-4 "^C4-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\)" 1 16 =ucs@cns "\tCU[+-]\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]+\\)") + (=cns11643-5 + "^C5-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\)" 1 16 + =ucs@cns + "\tCU[+-]\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]+\\)") + (=cns11643-6 + "^C6-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\)" 1 16 + =ucs@cns + "\tCU[+-]\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]+\\)") (=big5 "^B-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\)" 1 16 =ucs@big5 "\tBU[+-]\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]+\\)") + (=ks-x1001 + "^K0-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\)" 1 16 + =ucs@ks + "\tKU[+-]\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]+\\)") (=jef-china3 "^JC3-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\)" 1 16 nil @@ -132,15 +148,23 @@ UCS-REGEXP is a regular expression to match against (put-char-attribute chr ccs code)) (when (and ucs-code (not - (eq (or (encode-char chr ucs-ccs 'defined-only) - (if (memq ucs-ccs '(=ucs@jis - =ucs@jis/1990 - =ucs@jis/2000 - ;; ucs-big5 - )) - (encode-char chr '=ucs@jis/fw - 'defined-only) - (char-feature chr '=>ucs))) + (eq (or + (encode-char chr ucs-ccs 'defined-only) + (cond + ((memq ucs-ccs '(=ucs@jis + =ucs@jis/1990 + =ucs@jis/2000)) + (encode-char chr '=ucs@jis/fw 'defined-only)) + ((eq ucs-ccs '=ucs@gb) + (encode-char chr '=ucs@gb/fw 'defined-only)) + ;; ((eq ucs-ccs '=ucs@cns) + ;; (encode-char chr '=ucs@cns/fw 'defined-only)) + ;; ((eq ucs-ccs '=ucs@big5) + ;; nil) + ;; ((eq ucs-ccs '=ucs@ks) + ;; (encode-char chr '=ucs@ks/fw 'defined-only)) + (t + (char-feature chr '=>ucs)))) ucs-code))) (put-char-attribute chr ucs-ccs ucs-code)) (when (and ucs @@ -148,7 +172,10 @@ UCS-REGEXP is a regular expression to match against (and (not (memq ucs-ccs '(=ucs@jis =ucs@jis/1990 =ucs@jis/2000 - ;; ucs-big5 + =ucs@gb + =ucs@cns + =ucs@big5 + =ucs@ks ))) (char-feature chr '=>ucs))) ucs))) @@ -160,6 +187,22 @@ UCS-REGEXP is a regular expression to match against (put-char-attribute chr ucs-ccs ucs))))) (forward-line))))) +;;;###autoload +(defun ucs-compat-read-file (filename) + (interactive "fUCS-compat file : ") + (with-temp-buffer + (buffer-disable-undo) + (insert-file-contents filename) + (goto-char (point-min)) + (let (ucs ucs*) + (while (re-search-forward + "^ *U[---+]\\([0-9A-F]+\\)\t *U[---+]\\([0-9A-F]+\\)" nil t) + (setq ucs (string-to-int (match-string 1) 16) + ucs* (string-to-int (match-string 2) 16)) + (put-char-attribute (decode-char '=ucs ucs) '=>ucs* ucs*) + )))) + +;;;###autoload (defun jp-jouyou-read-file (filename) (interactive "fjp-jouyou file : ") (with-temp-buffer