6 (($n, $m, $c) = split(" ", $_, 3)) >= 3 || next;
12 foreach $name (@NAME) {
17 print "$name\t$map\t$code\n";
22 open(OUT, "> ${name}_ucs.map");
26 (($i, $u) = split(" ")) || next;
31 if ($a >= 0xA1 && $a <= 0xFE && $b >= 0xA1 && $b <= 0xFE) {
32 ($i >= 0xA2A1 && $i <= 0xA2AA) ||
33 ($i >= 0xA6E0 && $i <= 0xA6F5) ||
34 ($i >= 0xA8BB && $i <= 0xA8BB) ||
35 ($i >= 0xA8BD && $i <= 0xA8BD) ||
36 ($i >= 0xA8BE && $i <= 0xA8BE) ||
37 ($i >= 0xA8C0 && $i <= 0xA8C0) || next;
46 # These conversion tables between $code and
47 # Unicode were made from
49 # ftp://ftp.unicode.org/Public/MAPPINGS/$map.
54 #define N_ucs_gbk_80_map 1
56 static wc_map ucs_gbk_80_map[ N_ucs_gbk_80_map ] = {
60 static wc_uint16 ${name}_ucs_map[ 0x7E * 0xBE - 0x5E * 0x5E + 0x0A + 0x16 + 0x06 ] = {
63 for $ub (0x81 .. 0xA0) {
64 for $lb (0x40 .. 0x7E, 0x80 .. 0xFE) {
65 $_ = ($ub << 8) + $lb;
66 printf OUT " 0x%.4X,\t/* 0x%.4X */\n", $to_ucs{$_}, $_;
69 for $ub (0xA1 .. 0xFE) {
70 for $lb (0x40 .. 0x7E, 0x80 .. 0xA0) {
71 $_ = ($ub << 8) + $lb;
72 printf OUT " 0x%.4X,\t/* 0x%.4X */\n", $to_ucs{$_}, $_;
75 for $lb (0xA1 .. 0xAA) { # 0x0A
76 $_ = ($ub << 8) + $lb;
77 printf OUT " 0x%.4X,\t/* 0x%.4X */\n", $to_ucs{$_}, $_;
79 } elsif ($ub == 0xA6) {
80 for $lb (0xE0 .. 0xF5) { # 0x16
81 $_ = ($ub << 8) + $lb;
82 printf OUT " 0x%.4X,\t/* 0x%.4X */\n", $to_ucs{$_}, $_;
84 } elsif ($ub == 0xA8) {
85 for $lb (0xBB .. 0xC0) { # 0x06
86 $_ = ($ub << 8) + $lb;
87 printf OUT " 0x%.4X,\t/* 0x%.4X */\n", $to_ucs{$_}, $_;
92 @ucs = sort { $a <=> $b } keys %from_ucs;
98 #define N_ucs_${name}_map $nucs
100 static wc_map ucs_${name}_map[ N_ucs_${name}_map ] = {
103 printf OUT " { 0x%.4X, 0x%.4X },\n", $_, $from_ucs{$_};
114 gbk VENDORS/MICSFT/WINDOWS/CP936.TXT GBK/CP936 (Chinese)