aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorKenichi Handa2004-01-27 01:59:12 +0000
committerKenichi Handa2004-01-27 01:59:12 +0000
commit5d1bff2082c0af3e5d00bd5b8873c2bad5201836 (patch)
treedd00cd764c784f985e6b1c8a8accab4090763ad5 /admin
parent740ddd2766b6c5eb95431308972d95c4c99b1110 (diff)
downloademacs-5d1bff2082c0af3e5d00bd5b8873c2bad5201836.tar.gz
emacs-5d1bff2082c0af3e5d00bd5b8873c2bad5201836.zip
New file.
Diffstat (limited to 'admin')
-rw-r--r--admin/charsets/cp51932.awk57
-rw-r--r--admin/charsets/eucjp-ms.awk83
2 files changed, 140 insertions, 0 deletions
diff --git a/admin/charsets/cp51932.awk b/admin/charsets/cp51932.awk
new file mode 100644
index 00000000000..ac5498551d4
--- /dev/null
+++ b/admin/charsets/cp51932.awk
@@ -0,0 +1,57 @@
1# cp51932.awk -- Generate a translation table for CP51932.
2# Copyright (C) 2004
3# National Institute of Advanced Industrial Science and Technology (AIST)
4# Registration Number H13PRO009
5#
6# This file is part of GNU Emacs.
7#
8# GNU Emacs is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 2, or (at your option)
11# any later version.
12#
13# GNU Emacs is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with GNU Emacs; see the file COPYING. If not, write to the
20# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21# Boston, MA 02111-1307, USA.
22
23# Comment:
24
25# Genereate a translation table for CP51932 (EUC-JP of MicroSoft Version).
26# It maps invalid JISX0208 code points used by CP51932 to Unicode.
27# 4th field of the input has these meanings:
28# 0: JISX0208 characters.
29# 1: NEC special characters.
30# 2: IBM extension characters.
31# 3: NEC selection of IBM extension characters.
32# Among them, 1 and 3 are the target characters. 2 should have
33# already been mapped to 1 or 3.
34
35BEGIN {
36 print ";;; cp51932.el -- translation table for CP51932. -*- no-byte-compile: t -*-";
37 print ";;; Automatically genrated from CP932-2BYTE.map";
38 print "(let ((map";
39 printf " '(;JISEXT<->UNICODE";
40}
41
42/# [13]/ {
43 printf "\n (#x%s . #x%s)", $5 ,substr($2, 3, 4);
44}
45
46END {
47 print ")))";
48 print " (mapc #'(lambda (x)";
49 print " (setcar x (decode-char 'japanese-jisx0208 (car x))))";
50 print " map)";
51 print " (define-translation-table 'cp51932-decode map)";
52 print " (mapc #'(lambda (x)";
53 print " (let ((tmp (car x)))";
54 print " (setcar x (cdr x)) (setcdr x tmp)))";
55 print " map)";
56 print " (define-translation-table 'cp51932-encode map))";
57}
diff --git a/admin/charsets/eucjp-ms.awk b/admin/charsets/eucjp-ms.awk
new file mode 100644
index 00000000000..9dae6807570
--- /dev/null
+++ b/admin/charsets/eucjp-ms.awk
@@ -0,0 +1,83 @@
1# eucjp-ms.awk -- Generate a translation table for eucJP-ms.
2# Copyright (C) 2004
3# National Institute of Advanced Industrial Science and Technology (AIST)
4# Registration Number H13PRO009
5#
6# This file is part of GNU Emacs.
7#
8# GNU Emacs is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 2, or (at your option)
11# any later version.
12#
13# GNU Emacs is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with GNU Emacs; see the file COPYING. If not, write to the
20# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21# Boston, MA 02111-1307, USA.
22
23# Comment:
24
25# eucJP-ms is one of eucJP-open encoding defined at this page:
26# http://www.opengroup.or.jp/jvc/cde/appendix.html
27
28BEGIN {
29 print ";;; eucjp-ms.el -- translation table for eucJP-ms. -*- no-byte-compile: t -*-";
30 print ";;; Automatically genrated from eucJP-13th.txt, eucJP-udc.txt, eucJP-ibmext.txt";
31 print "(let ((map";
32 printf " '(;JISEXT<->UNICODE";
33
34 tohex["A"] = 10;
35 tohex["B"] = 11;
36 tohex["C"] = 12;
37 tohex["D"] = 13;
38 tohex["E"] = 14;
39 tohex["F"] = 15;
40}
41
42function decode_hex(str) {
43 n = 0;
44 len = length(str);
45 for (i = 1; i <= len; i++)
46 {
47 c = substr(str, i, 1);
48 if (c >= "0" && c <= "9")
49 n = n * 16 + (c - "0");
50 else
51 n = n * 16 + tohex[c];
52 }
53 return n;
54}
55
56/0x8F/ {
57 code = decode_hex(substr($1, 5, 4));
58 code -= 32896; # code -= 0x8080
59 printf "\n (#x%04x #x%s)", code, substr($2, 3, 4);
60 next;
61}
62
63/0x[A-F]/ {
64 code = decode_hex(substr($1, 3, 4));
65 code -= 32896; # code -= 0x8080
66 printf "\n (#x%04x . #x%s)", code, substr($2, 3, 4);
67}
68
69END {
70 print ")))";
71 print " (mapc #'(lambda (x)";
72 print " (if (integerp (cdr x))";
73 print " (setcar x (decode-char 'japanese-jisx0208 (car x)))";
74 print " (setcar x (decode-char 'japanese-jisx0212 (car x)))";
75 print " (setcdr x (cadr x))))";
76 print " map)";
77 print " (define-translation-table 'eucjp-ms-decode map)";
78 print " (mapc #'(lambda (x)";
79 print " (let ((tmp (car x)))";
80 print " (setcar x (cdr x)) (setcdr x tmp)))";
81 print " map)";
82 print " (define-translation-table 'eucjp-ms-encode map))";
83}