diff options
| author | Kenichi Handa | 2004-01-30 02:12:07 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2004-01-30 02:12:07 +0000 |
| commit | a9cf9d0d6c1e39213f304d9407bef3969ca9bc43 (patch) | |
| tree | dd0a3055379687871100ac0aadd0102ab24ca66c /admin | |
| parent | 2e454bb6e0e85d432cb3439dd27c5e80b4d33241 (diff) | |
| download | emacs-a9cf9d0d6c1e39213f304d9407bef3969ca9bc43.tar.gz emacs-a9cf9d0d6c1e39213f304d9407bef3969ca9bc43.zip | |
Append user defined area of CP932.
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/charsets/cp932.awk | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/admin/charsets/cp932.awk b/admin/charsets/cp932.awk index 077e35113e2..138f0d0db4c 100644 --- a/admin/charsets/cp932.awk +++ b/admin/charsets/cp932.awk | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # cp932.awk -- Add sort key at the tail of each line of CP932-2BYTE.map. | 1 | # cp932.awk -- Add sort keys and append user defined area to CP932-2BYTE.map. |
| 2 | # Copyright (C) 2004 | 2 | # Copyright (C) 2004 |
| 3 | # National Institute of Advanced Industrial Science and Technology (AIST) | 3 | # National Institute of Advanced Industrial Science and Technology (AIST) |
| 4 | # Registration Number H13PRO009 | 4 | # Registration Number H13PRO009 |
| @@ -30,6 +30,7 @@ | |||
| 30 | # 1: NEC special characters. | 30 | # 1: NEC special characters. |
| 31 | # 2: IBM extension characters. | 31 | # 2: IBM extension characters. |
| 32 | # 3: NEC selection of IBM extension characters. | 32 | # 3: NEC selection of IBM extension characters. |
| 33 | # 4: user defined area | ||
| 33 | 34 | ||
| 34 | BEGIN { | 35 | BEGIN { |
| 35 | tohex["A"] = 10; | 36 | tohex["A"] = 10; |
| @@ -64,6 +65,7 @@ function sjis_to_jis_ku(code) | |||
| 64 | j1 = s1 * 2 - 352; # j1 = s1 * 2 - 0x160 | 65 | j1 = s1 * 2 - 352; # j1 = s1 * 2 - 0x160 |
| 65 | else | 66 | else |
| 66 | j1 = s1 * 2 - 224; # j1 = s1 * 2 - 0xE0 | 67 | j1 = s1 * 2 - 224; # j1 = s1 * 2 - 0xE0 |
| 68 | j2 = s2 - 126 # j2 = s2 - #x7E | ||
| 67 | } | 69 | } |
| 68 | else | 70 | else |
| 69 | { | 71 | { |
| @@ -71,6 +73,10 @@ function sjis_to_jis_ku(code) | |||
| 71 | j1 = s1 * 2 - 353; # j1 = s1 * 2 - 0x161 | 73 | j1 = s1 * 2 - 353; # j1 = s1 * 2 - 0x161 |
| 72 | else | 74 | else |
| 73 | j1 = s1 * 2 - 225; # j1 = s1 * 2 - 0xE1 | 75 | j1 = s1 * 2 - 225; # j1 = s1 * 2 - 0xE1 |
| 76 | if (s2 >= 127) # s2 >= #x7F | ||
| 77 | j2 = s2 - 32; | ||
| 78 | else | ||
| 79 | j2 = s2 - 31; | ||
| 74 | } | 80 | } |
| 75 | return j1 - 32; | 81 | return j1 - 32; |
| 76 | } | 82 | } |
| @@ -79,19 +85,32 @@ function sjis_to_jis_ku(code) | |||
| 79 | sjis=decode_hex(substr($1, 3, 4)) | 85 | sjis=decode_hex(substr($1, 3, 4)) |
| 80 | ku=sjis_to_jis_ku(sjis); | 86 | ku=sjis_to_jis_ku(sjis); |
| 81 | if (ku == 13) | 87 | if (ku == 13) |
| 82 | print $0" # 1"; | 88 | printf "%s # 1 %02X%02X\n", $0, j1, j2; |
| 83 | else if (ku >= 89 && ku <= 92) | 89 | else if (ku >= 89 && ku <= 92) |
| 84 | print $0" # 3"; | 90 | printf "%s # 3 %02X%02X\n", $0, j1, j2; |
| 85 | else | 91 | else |
| 86 | print $0" # 0"; | 92 | printf "%s # 0 %02X%02X\n", $0, j1, j2; |
| 87 | next; | 93 | next; |
| 88 | } | 94 | } |
| 89 | 95 | ||
| 90 | /^0xF/ { | 96 | /^0xF/ { |
| 91 | print $0" # 2"; | 97 | printf "%s # 2\n", $0; |
| 92 | next; | 98 | next; |
| 93 | } | 99 | } |
| 94 | 100 | ||
| 95 | { | 101 | { |
| 96 | print; | 102 | print; |
| 97 | } | 103 | } |
| 104 | |||
| 105 | END { | ||
| 106 | code = 57344; # 0xE000 | ||
| 107 | for (i = 240; i < 250; i++) | ||
| 108 | { | ||
| 109 | for (j = 64; j <= 126; j++) | ||
| 110 | printf "0x%02X%02X 0x%04X # 4\n", i, j, code++; | ||
| 111 | for (j = 128; j <= 158; j++) | ||
| 112 | printf "0x%02X%02X 0x%04X # 4\n", i, j, code++; | ||
| 113 | for (; j <= 252; j++) | ||
| 114 | printf "0x%02X%02X 0x%04X # 4\n", i, j, code++; | ||
| 115 | } | ||
| 116 | } | ||