• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revisión9026 (tree)
Tiempo2020-11-04 00:23:42
Autorzmatsuo

Log Message

文字コード関連のスクリプトを teraterm/unicode に移動

Cambiar Resumen

Diferencia incremental

--- branches/move_code_script/installer/conv.pl (revision 9025)
+++ branches/move_code_script/installer/conv.pl (nonexistent)
@@ -1,34 +0,0 @@
1-
2-#
3-# Unicodeをキーとして昇順にソートする
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[1])); # Unicode
24-# print "$column[0] -> $column[1] ($val)\n";
25- $table{$val} = hex($column[0]);
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-
--- branches/move_code_script/installer/hfs_conv.pl (revision 9025)
+++ branches/move_code_script/installer/hfs_conv.pl (nonexistent)
@@ -1,83 +0,0 @@
1-#
2-# Unicodeをキーとして昇順にソートする
3-#
4-# >perl hfs_conv.pl > hfs_plus.map
5-
6-$file = 'UNICODE DECOMPOSITION TABLE.htm';
7-
8-print <<EOD;
9-typedef struct hfsplus_codemap {
10- unsigned short illegal_code;
11- unsigned short first_code;
12- unsigned short second_code;
13-} hfsplus_codemap_t;
14-
15-/*
16- * cf. http://developer.apple.com/technotes/tn/tn1150table.html
17- *
18- */
19-static hfsplus_codemap_t mapHFSPlusUnicode[] = {
20-EOD
21-
22-&read_mapfile($file);
23-
24-print <<EOD;
25-};
26-EOD
27-
28-exit();
29-
30-sub read_mapfile {
31- my($file) = @_;
32- my(%table, $val, $key);
33-
34- $illegal = '';
35- $first = '';
36- $second = '';
37-
38- open(FP, $file) || die "error";
39- while ($line = <FP>) {
40-# print "$line\n";
41- if ($line =~ m|<P>0x(....)</P>|) {
42- $illegal = hex($1);
43- }
44- if ($line =~ m|<P>0x(....) 0x(....)</P>|) {
45- $first = hex($1);
46- $second = hex($2);
47-
48- push(@key, "$illegal,$first,$second");
49-
50- # printf " {0x%04X, 0x%04X, 0x%04X},\n", $illegal, $first, $second;
51- }
52- }
53- close(FP);
54-
55- # $firstをキーとしてソートする
56- $k = @key - 1;
57- while ($k >= 0) {
58- $j = -1;
59- for ($i = 1; $i <= $k; $i++) {
60- @m = split(/,/, $key[$i-1]);
61- @n = split(/,/, $key[$i]);
62- if ($m[1] > $n[1]) {
63- $j = $i - 1;
64- $t = $key[$j];
65- $key[$j] = $key[$i];
66- $key[$i] = $t;
67- }
68- }
69- $k = $j;
70- }
71-
72- foreach $s (@key) {
73- @n = split(/,/, $s);
74- printf " {0x%04X, 0x%04X, 0x%04X},\n", $n[0], $n[1], $n[2];
75- }
76-
77-# foreach $key (sort {$a <=> $b} keys %table) {
78-# @n = split(/,/, $table{$key});
79-# printf " {0x%04X, 0x%04X, 0x%04X},\n", $n[0], $key, $n[1];
80-# }
81-
82-}
83-
--- branches/move_code_script/teraterm/teraterm/unicode/conv_combining.md (nonexistent)
+++ branches/move_code_script/teraterm/teraterm/unicode/conv_combining.md (revision 9026)
@@ -0,0 +1,9 @@
1+# conv_combining.pl について
2+
3+- hfs_plus.map (現在は uni_combining.map) を出力するために作成された
4+- conv_combining.pl の前は installer/conv_hfs.pl だった
5+- uni_combining.map は直接人手で修正している
6+ - https://ja.osdn.net/cvs/view/ttssh2/teraterm/source/teraterm/hfs_plus.map?hideattic=0&view=log
7+ - https://ja.osdn.net/projects/ttssh2/svn/view/trunk/teraterm/teraterm/uni_combining.map?root=ttssh2&view=log
8+ - r6514 にて hfs_plus.map -> uni_combining.map
9+- 現在はこのスクリプトの出力をそのまま使用していない
--- branches/move_code_script/teraterm/teraterm/unicode/conv_combining.pl (nonexistent)
+++ branches/move_code_script/teraterm/teraterm/unicode/conv_combining.pl (revision 9026)
@@ -0,0 +1,83 @@
1+#
2+# Unicodeをキーとして昇順にソートする
3+#
4+# >perl hfs_conv.pl > hfs_plus.map
5+
6+$file = 'UNICODE DECOMPOSITION TABLE.htm';
7+
8+print <<EOD;
9+typedef struct hfsplus_codemap {
10+ unsigned short illegal_code;
11+ unsigned short first_code;
12+ unsigned short second_code;
13+} hfsplus_codemap_t;
14+
15+/*
16+ * cf. http://developer.apple.com/technotes/tn/tn1150table.html
17+ *
18+ */
19+static hfsplus_codemap_t mapHFSPlusUnicode[] = {
20+EOD
21+
22+&read_mapfile($file);
23+
24+print <<EOD;
25+};
26+EOD
27+
28+exit();
29+
30+sub read_mapfile {
31+ my($file) = @_;
32+ my(%table, $val, $key);
33+
34+ $illegal = '';
35+ $first = '';
36+ $second = '';
37+
38+ open(FP, $file) || die "error";
39+ while ($line = <FP>) {
40+# print "$line\n";
41+ if ($line =~ m|<P>0x(....)</P>|) {
42+ $illegal = hex($1);
43+ }
44+ if ($line =~ m|<P>0x(....) 0x(....)</P>|) {
45+ $first = hex($1);
46+ $second = hex($2);
47+
48+ push(@key, "$illegal,$first,$second");
49+
50+ # printf " {0x%04X, 0x%04X, 0x%04X},\n", $illegal, $first, $second;
51+ }
52+ }
53+ close(FP);
54+
55+ # $firstをキーとしてソートする
56+ $k = @key - 1;
57+ while ($k >= 0) {
58+ $j = -1;
59+ for ($i = 1; $i <= $k; $i++) {
60+ @m = split(/,/, $key[$i-1]);
61+ @n = split(/,/, $key[$i]);
62+ if ($m[1] > $n[1]) {
63+ $j = $i - 1;
64+ $t = $key[$j];
65+ $key[$j] = $key[$i];
66+ $key[$i] = $t;
67+ }
68+ }
69+ $k = $j;
70+ }
71+
72+ foreach $s (@key) {
73+ @n = split(/,/, $s);
74+ printf " {0x%04X, 0x%04X, 0x%04X},\n", $n[0], $n[1], $n[2];
75+ }
76+
77+# foreach $key (sort {$a <=> $b} keys %table) {
78+# @n = split(/,/, $table{$key});
79+# printf " {0x%04X, 0x%04X, 0x%04X},\n", $n[0], $key, $n[1];
80+# }
81+
82+}
83+
--- branches/move_code_script/teraterm/teraterm/unicode/conv_sjis.md (nonexistent)
+++ branches/move_code_script/teraterm/teraterm/unicode/conv_sjis.md (revision 9026)
@@ -0,0 +1,8 @@
1+# conv_sjis.pl について
2+
3+- uni2sjis.map を作るために作成された
4+- conv_sjis.pl の前は installer/conv.pl だった
5+- uni2sjis.map は直接人手で修正している
6+ - https://ja.osdn.net/cvs/view/ttssh2/teraterm/source/teraterm/uni2sjis.map?hideattic=0&view=log
7+ - https://ja.osdn.net/projects/ttssh2/svn/view/trunk/teraterm/teraterm/uni2sjis.map?root=ttssh2&view=log
8+- 現在はこのスクリプトの出力をそのまま使用していない
--- branches/move_code_script/teraterm/teraterm/unicode/conv_sjis.pl (nonexistent)
+++ branches/move_code_script/teraterm/teraterm/unicode/conv_sjis.pl (revision 9026)
@@ -0,0 +1,34 @@
1+
2+#
3+# Unicodeをキーとして昇順にソートする
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[1])); # Unicode
24+# print "$column[0] -> $column[1] ($val)\n";
25+ $table{$val} = hex($column[0]);
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+
Show on old repository browser