スクリプトの使い方を追記
- スクリプトが動作するよう修正
- rev_conv.pl を installer フォルダから移動- ticket #40988
@@ -1,34 +0,0 @@ | ||
1 | - | |
2 | -# | |
3 | -# Shift_JISをキーとして昇順に出力する | |
4 | -# | |
5 | - | |
6 | -$file = 'SHIFTJIS_TXT.htm'; | |
7 | - | |
8 | -&read_mapfile($file); | |
9 | -exit(); | |
10 | - | |
11 | -sub read_mapfile { | |
12 | - my($file) = @_; | |
13 | - my(%table, $val, $key); | |
14 | - | |
15 | - open(FP, $file) || die "error"; | |
16 | - while ($line = <FP>) { | |
17 | - if ($line =~ /^\#/) {next;} | |
18 | - if ($line =~ m+^\/+) {next;} | |
19 | - if ($line =~ m+^\<+) {next;} | |
20 | - $line =~ s/^\s+//; | |
21 | - @column = split(/\s+/, $line); | |
22 | - | |
23 | - $val = int(hex($column[0])); # Unicode | |
24 | -# print "$column[0] -> $column[1] ($val)\n"; | |
25 | - $table{$val} = hex($column[1]); | |
26 | -# printf "%d => %x\n", $val, $table{$val}; | |
27 | - } | |
28 | - close(FP); | |
29 | - | |
30 | - foreach $key (sort {$a <=> $b} keys %table) { | |
31 | - printf " { 0x%04X, 0x%04X },\n", $key, $table{$key}; | |
32 | - } | |
33 | -} | |
34 | - |
@@ -18,3 +18,11 @@ | ||
18 | 18 | - UNICODE DECOMPOSITION TABLE.htm |
19 | 19 | - 移動 |
20 | 20 | - http://developer.apple.com/technotes/tn/tn1150table.html |
21 | + | |
22 | +## 使い方 | |
23 | + | |
24 | +``` | |
25 | +wget https://developer.apple.com/library/archive/technotes/tn/tn1150table.html | |
26 | +mv tn1150table.html "UNICODE DECOMPOSITION TABLE.htm" | |
27 | +perl conv_combining.pl > uni_combining.map | |
28 | +``` |
@@ -38,10 +38,10 @@ | ||
38 | 38 | open(FP, $file) || die "error"; |
39 | 39 | while ($line = <FP>) { |
40 | 40 | # print "$line\n"; |
41 | - if ($line =~ m|<P>0x(....)</P>|) { | |
41 | + if ($line =~ m|<P>0x(....)</p>|) { | |
42 | 42 | $illegal = hex($1); |
43 | 43 | } |
44 | - if ($line =~ m|<P>0x(....) 0x(....)</P>|) { | |
44 | + if ($line =~ m|<P>0x(....) 0x(....)</p>|) { | |
45 | 45 | $first = hex($1); |
46 | 46 | $second = hex($2); |
47 | 47 |
@@ -13,3 +13,10 @@ | ||
13 | 13 | - ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/SHIFTJIS.TXT |
14 | 14 | - 作成当時 |
15 | 15 | - SHIFTJIS_TXT.htm |
16 | + | |
17 | +## 使い方 | |
18 | + | |
19 | +``` | |
20 | +wget ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/SHIFTJIS.TXT | |
21 | +perl conv_sjis.pl > uni2sjis.map | |
22 | +``` |
@@ -3,7 +3,7 @@ | ||
3 | 3 | # Unicodeをキーとして昇順にソートする |
4 | 4 | # |
5 | 5 | |
6 | -$file = 'SHIFTJIS_TXT.htm'; | |
6 | +$file = 'SHIFTJIS.TXT'; | |
7 | 7 | |
8 | 8 | &read_mapfile($file); |
9 | 9 | exit(); |
@@ -0,0 +1,34 @@ | ||
1 | + | |
2 | +# | |
3 | +# Shift_JISをキーとして昇順に出力する | |
4 | +# | |
5 | + | |
6 | +$file = 'SHIFTJIS_TXT.htm'; | |
7 | + | |
8 | +&read_mapfile($file); | |
9 | +exit(); | |
10 | + | |
11 | +sub read_mapfile { | |
12 | + my($file) = @_; | |
13 | + my(%table, $val, $key); | |
14 | + | |
15 | + open(FP, $file) || die "error"; | |
16 | + while ($line = <FP>) { | |
17 | + if ($line =~ /^\#/) {next;} | |
18 | + if ($line =~ m+^\/+) {next;} | |
19 | + if ($line =~ m+^\<+) {next;} | |
20 | + $line =~ s/^\s+//; | |
21 | + @column = split(/\s+/, $line); | |
22 | + | |
23 | + $val = int(hex($column[0])); # Unicode | |
24 | +# print "$column[0] -> $column[1] ($val)\n"; | |
25 | + $table{$val} = hex($column[1]); | |
26 | +# printf "%d => %x\n", $val, $table{$val}; | |
27 | + } | |
28 | + close(FP); | |
29 | + | |
30 | + foreach $key (sort {$a <=> $b} keys %table) { | |
31 | + printf " { 0x%04X, 0x%04X },\n", $key, $table{$key}; | |
32 | + } | |
33 | +} | |
34 | + |