annotate admin/charsets/eucjp-ms.awk @ 93461:3afeea9a48a3

* vc.el (vc-status-add-entry): Assume ENTRY is a list not a cons. (vc-status-mark-buffer-changed): Handle the extra field. * vc-bzr.el (vc-bzr-after-dir-status): * vc-cvs.el (vc-cvs-after-dir-status): * vc-hg.el (vc-hg-after-dir-status): * vc-svn.el (vc-svn-after-dir-status): Return a list not a cons.
author Dan Nicolaescu <dann@ics.uci.edu>
date Mon, 31 Mar 2008 15:36:56 +0000
parents c50a10842bd9
children eb2d9dfc8486
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
89750
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
1 # eucjp-ms.awk -- Generate a translation table for eucJP-ms.
91415
c50a10842bd9 Update copyright years and GPL version.
Glenn Morris <rgm@gnu.org>
parents: 89916
diff changeset
2 # Copyright (C) 2004, 2005, 2006, 2007, 2008
89750
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
3 # National Institute of Advanced Industrial Science and Technology (AIST)
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
4 # Registration Number H13PRO009
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
5 #
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
6 # This file is part of GNU Emacs.
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
7 #
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
8 # GNU Emacs is free software; you can redistribute it and/or modify
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
9 # it under the terms of the GNU General Public License as published by
91415
c50a10842bd9 Update copyright years and GPL version.
Glenn Morris <rgm@gnu.org>
parents: 89916
diff changeset
10 # the Free Software Foundation; either version 3, or (at your option)
89750
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
11 # any later version.
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
12 #
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
13 # GNU Emacs is distributed in the hope that it will be useful,
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
16 # GNU General Public License for more details.
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
17 #
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
18 # You should have received a copy of the GNU General Public License
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
19 # along with GNU Emacs; see the file COPYING. If not, write to the
91415
c50a10842bd9 Update copyright years and GPL version.
Glenn Morris <rgm@gnu.org>
parents: 89916
diff changeset
20 # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
c50a10842bd9 Update copyright years and GPL version.
Glenn Morris <rgm@gnu.org>
parents: 89916
diff changeset
21 # Boston, MA 02110-1301, USA.
89750
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
22
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
23 # Comment:
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
24
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
25 # eucJP-ms is one of eucJP-open encoding defined at this page:
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
26 # http://www.opengroup.or.jp/jvc/cde/appendix.html
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
27
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
28 BEGIN {
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
29 print ";;; eucjp-ms.el -- translation table for eucJP-ms. -*- no-byte-compile: t -*-";
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
30 print ";;; Automatically genrated from eucJP-13th.txt, eucJP-udc.txt, eucJP-ibmext.txt";
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
31 print "(let ((map";
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
32 printf " '(;JISEXT<->UNICODE";
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
33
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
34 tohex["A"] = 10;
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
35 tohex["B"] = 11;
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
36 tohex["C"] = 12;
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
37 tohex["D"] = 13;
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
38 tohex["E"] = 14;
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
39 tohex["F"] = 15;
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
40 }
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
41
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
42 function decode_hex(str) {
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
43 n = 0;
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
44 len = length(str);
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
45 for (i = 1; i <= len; i++)
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
46 {
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
47 c = substr(str, i, 1);
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
48 if (c >= "0" && c <= "9")
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
49 n = n * 16 + (c - "0");
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
50 else
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
51 n = n * 16 + tohex[c];
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
52 }
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
53 return n;
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
54 }
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
55
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
56 /0x8F/ {
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
57 code = decode_hex(substr($1, 5, 4));
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
58 code -= 32896; # code -= 0x8080
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
59 printf "\n (#x%04x #x%s)", code, substr($2, 3, 4);
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
60 next;
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
61 }
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
62
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
63 /0x[A-F]/ {
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
64 code = decode_hex(substr($1, 3, 4));
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
65 code -= 32896; # code -= 0x8080
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
66 printf "\n (#x%04x . #x%s)", code, substr($2, 3, 4);
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
67 }
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
68
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
69 END {
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
70 print ")))";
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
71 print " (mapc #'(lambda (x)";
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
72 print " (if (integerp (cdr x))";
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
73 print " (setcar x (decode-char 'japanese-jisx0208 (car x)))";
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
74 print " (setcar x (decode-char 'japanese-jisx0212 (car x)))";
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
75 print " (setcdr x (cadr x))))";
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
76 print " map)";
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
77 print " (define-translation-table 'eucjp-ms-decode map)";
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
78 print " (mapc #'(lambda (x)";
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
79 print " (let ((tmp (car x)))";
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
80 print " (setcar x (cdr x)) (setcdr x tmp)))";
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
81 print " map)";
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
82 print " (define-translation-table 'eucjp-ms-encode map))";
d6d9f1efd684 New file.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
83 }
89916
e0e4e6a0599f Changes from arch/CVS synchronization
Miles Bader <miles@gnu.org>
parents: 89750
diff changeset
84
e0e4e6a0599f Changes from arch/CVS synchronization
Miles Bader <miles@gnu.org>
parents: 89750
diff changeset
85 # arch-tag: d9cc7af7-2d6e-48cd-8eed-a6d25226de7c