Revision: 9189 https://osdn.net/projects/ttssh2/scm/svn/commits/9189 Author: zmatsuo Date: 2021-02-28 17:31:48 +0900 (Sun, 28 Feb 2021) Log Message: ----------- Merge branch 'move_code_script' into trunk Added Paths: ----------- trunk/teraterm/teraterm/unicode/conv_combining.md trunk/teraterm/teraterm/unicode/conv_combining.pl trunk/teraterm/teraterm/unicode/conv_sjis.md trunk/teraterm/teraterm/unicode/conv_sjis.pl trunk/teraterm/teraterm/unicode/conv_uni.md trunk/teraterm/teraterm/unicode/conv_uni.pl trunk/teraterm/teraterm/unicode/readme.md Removed Paths: ------------- trunk/installer/conv.pl trunk/installer/hfs_conv.pl trunk/installer/rev_conv.pl Property Changed: ---------------- trunk/ trunk/teraterm/ -------------- next part -------------- Index: trunk =================================================================== --- trunk 2021-02-26 15:21:27 UTC (rev 9188) +++ trunk 2021-02-28 08:31:48 UTC (rev 9189) Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo ## -1,5 +1,6 ## /branches/drag_and_drop:7130,7139,7141,7143-7147 /branches/flowctrl_dsrdtr:7825-7827 +/branches/move_code_script:9026-9185 /branches/openssl_1_1_1_v2:7785-7786,7788-7808,7811-7812,7814-7815,7819-7822,7829,7832-7834,7838-7843,7846-7847,7855-7856,7858,7861-7863,7873-7877,7880-7881,7884-7888,7890-7892,7894-7895,7898,7900,7902-7903,7909,7924,7934,7954-7957,7959,7973,7975,7979-7980,8019,8208,8256 /branches/openssl_1_1_1_v3:8258,8264-8265 /branches/portfwd_memleak:7732,7736-7737,7764 Deleted: trunk/installer/conv.pl =================================================================== --- trunk/installer/conv.pl 2021-02-26 15:21:27 UTC (rev 9188) +++ trunk/installer/conv.pl 2021-02-28 08:31:48 UTC (rev 9189) @@ -1,34 +0,0 @@ - -# -# Unicode\x82\xF0\x83L\x81[\x82Ƃ\xB5\x82ď\xB8\x8F\x87\x82Ƀ\\x81[\x83g\x82\xB7\x82\xE9 -# - -$file = 'SHIFTJIS_TXT.htm'; - -&read_mapfile($file); -exit(); - -sub read_mapfile { - my($file) = @_; - my(%table, $val, $key); - - open(FP, $file) || die "error"; - while ($line = <FP>) { - if ($line =~ /^\#/) {next;} - if ($line =~ m+^\/+) {next;} - if ($line =~ m+^\<+) {next;} - $line =~ s/^\s+//; - @column = split(/\s+/, $line); - - $val = int(hex($column[1])); # Unicode -# print "$column[0] -> $column[1] ($val)\n"; - $table{$val} = hex($column[0]); -# printf "%d => %x\n", $val, $table{$val}; - } - close(FP); - - foreach $key (sort {$a <=> $b} keys %table) { - printf " { 0x%04X, 0x%04X },\n", $key, $table{$key}; - } -} - Deleted: trunk/installer/hfs_conv.pl =================================================================== --- trunk/installer/hfs_conv.pl 2021-02-26 15:21:27 UTC (rev 9188) +++ trunk/installer/hfs_conv.pl 2021-02-28 08:31:48 UTC (rev 9189) @@ -1,83 +0,0 @@ -# -# Unicode\x82\xF0\x83L\x81[\x82Ƃ\xB5\x82ď\xB8\x8F\x87\x82Ƀ\\x81[\x83g\x82\xB7\x82\xE9 -# -# >perl hfs_conv.pl > hfs_plus.map - -$file = 'UNICODE DECOMPOSITION TABLE.htm'; - -print <<EOD; -typedef struct hfsplus_codemap { - unsigned short illegal_code; - unsigned short first_code; - unsigned short second_code; -} hfsplus_codemap_t; - -/* - * cf. http://developer.apple.com/technotes/tn/tn1150table.html - * - */ -static hfsplus_codemap_t mapHFSPlusUnicode[] = { -EOD - -&read_mapfile($file); - -print <<EOD; -}; -EOD - -exit(); - -sub read_mapfile { - my($file) = @_; - my(%table, $val, $key); - - $illegal = ''; - $first = ''; - $second = ''; - - open(FP, $file) || die "error"; - while ($line = <FP>) { -# print "$line\n"; - if ($line =~ m|<P>0x(....)</P>|) { - $illegal = hex($1); - } - if ($line =~ m|<P>0x(....) 0x(....)</P>|) { - $first = hex($1); - $second = hex($2); - - push(@key, "$illegal,$first,$second"); - - # printf " {0x%04X, 0x%04X, 0x%04X},\n", $illegal, $first, $second; - } - } - close(FP); - - # $first\x82\xF0\x83L\x81[\x82Ƃ\xB5\x82ă\\x81[\x83g\x82\xB7\x82\xE9 - $k = @key - 1; - while ($k >= 0) { - $j = -1; - for ($i = 1; $i <= $k; $i++) { - @m = split(/,/, $key[$i-1]); - @n = split(/,/, $key[$i]); - if ($m[1] > $n[1]) { - $j = $i - 1; - $t = $key[$j]; - $key[$j] = $key[$i]; - $key[$i] = $t; - } - } - $k = $j; - } - - foreach $s (@key) { - @n = split(/,/, $s); - printf " {0x%04X, 0x%04X, 0x%04X},\n", $n[0], $n[1], $n[2]; - } - -# foreach $key (sort {$a <=> $b} keys %table) { -# @n = split(/,/, $table{$key}); -# printf " {0x%04X, 0x%04X, 0x%04X},\n", $n[0], $key, $n[1]; -# } - -} - Deleted: trunk/installer/rev_conv.pl =================================================================== --- trunk/installer/rev_conv.pl 2021-02-26 15:21:27 UTC (rev 9188) +++ trunk/installer/rev_conv.pl 2021-02-28 08:31:48 UTC (rev 9189) @@ -1,34 +0,0 @@ - -# -# Shift_JIS\x82\xF0\x83L\x81[\x82Ƃ\xB5\x82ď\xB8\x8F\x87\x82ɏo\x97͂\xB7\x82\xE9 -# - -$file = 'SHIFTJIS_TXT.htm'; - -&read_mapfile($file); -exit(); - -sub read_mapfile { - my($file) = @_; - my(%table, $val, $key); - - open(FP, $file) || die "error"; - while ($line = <FP>) { - if ($line =~ /^\#/) {next;} - if ($line =~ m+^\/+) {next;} - if ($line =~ m+^\<+) {next;} - $line =~ s/^\s+//; - @column = split(/\s+/, $line); - - $val = int(hex($column[0])); # Unicode -# print "$column[0] -> $column[1] ($val)\n"; - $table{$val} = hex($column[1]); -# printf "%d => %x\n", $val, $table{$val}; - } - close(FP); - - foreach $key (sort {$a <=> $b} keys %table) { - printf " { 0x%04X, 0x%04X },\n", $key, $table{$key}; - } -} - Index: trunk/teraterm =================================================================== --- trunk/teraterm 2021-02-26 15:21:27 UTC (rev 9188) +++ trunk/teraterm 2021-02-28 08:31:48 UTC (rev 9189) Property changes on: trunk/teraterm ___________________________________________________________________ Modified: svn:mergeinfo ## -1,5 +1,6 ## /branches/drag_and_drop/teraterm:7130,7139,7141,7143-7147 /branches/flowctrl_dsrdtr/teraterm:7825-7827 +/branches/move_code_script/teraterm:9026-9185 /branches/openssl_1_1_1_v2/teraterm:7819-7822,7829,7832-7834,7838-7843,7846-7847,7855-7856,7858,7861-7863,7979-7980 /branches/openssl_1_1_1_v3/teraterm:8258 /branches/serial_port_improved/teraterm:8119,8140-8141,8144,8150,8158-8160,8163,8170,8172,8183,8185,8204,8209,8212-8215 Copied: trunk/teraterm/teraterm/unicode/conv_combining.md (from rev 9185, branches/move_code_script/teraterm/teraterm/unicode/conv_combining.md) =================================================================== --- trunk/teraterm/teraterm/unicode/conv_combining.md (rev 0) +++ trunk/teraterm/teraterm/unicode/conv_combining.md 2021-02-28 08:31:48 UTC (rev 9189) @@ -0,0 +1,28 @@ +# conv_combining.pl について + +- hfs_plus.map (現在は uni_combining.map) を出力するために作成された +- conv_combining.pl の前は installer/conv_hfs.pl だった +- uni_combining.map は直接人手で修正している + - https://ja.osdn.net/cvs/view/ttssh2/teraterm/source/teraterm/hfs_plus.map?hideattic=0&view=log + - https://ja.osdn.net/projects/ttssh2/svn/view/trunk/teraterm/teraterm/uni_combining.map?root=ttssh2&view=log + - r6514 にて hfs_plus.map -> uni_combining.map +- 現在はこのスクリプトの出力をそのまま使用していない + +## 入力ファイル + +- 現在の入手先 + - https://developer.apple.com/library/archive/technotes/tn/tn1150table.html + +- 以前 + - スクリプト作成当時 + - UNICODE DECOMPOSITION TABLE.htm + - 移動 + - http://developer.apple.com/technotes/tn/tn1150table.html + +## 使い方 + +``` +wget https://developer.apple.com/library/archive/technotes/tn/tn1150table.html +mv tn1150table.html "UNICODE DECOMPOSITION TABLE.htm" +perl conv_combining.pl > uni_combining.map +``` Copied: trunk/teraterm/teraterm/unicode/conv_combining.pl (from rev 9185, branches/move_code_script/teraterm/teraterm/unicode/conv_combining.pl) =================================================================== --- trunk/teraterm/teraterm/unicode/conv_combining.pl (rev 0) +++ trunk/teraterm/teraterm/unicode/conv_combining.pl 2021-02-28 08:31:48 UTC (rev 9189) @@ -0,0 +1,83 @@ +# +# Unicode\x82\xF0\x83L\x81[\x82Ƃ\xB5\x82ď\xB8\x8F\x87\x82Ƀ\\x81[\x83g\x82\xB7\x82\xE9 +# +# >perl hfs_conv.pl > hfs_plus.map + +$file = 'UNICODE DECOMPOSITION TABLE.htm'; + +print <<EOD; +typedef struct hfsplus_codemap { + unsigned short illegal_code; + unsigned short first_code; + unsigned short second_code; +} hfsplus_codemap_t; + +/* + * cf. http://developer.apple.com/technotes/tn/tn1150table.html + * + */ +static hfsplus_codemap_t mapHFSPlusUnicode[] = { +EOD + +&read_mapfile($file); + +print <<EOD; +}; +EOD + +exit(); + +sub read_mapfile { + my($file) = @_; + my(%table, $val, $key); + + $illegal = ''; + $first = ''; + $second = ''; + + open(FP, $file) || die "error"; + while ($line = <FP>) { +# print "$line\n"; + if ($line =~ m|<P>0x(....)</p>|) { + $illegal = hex($1); + } + if ($line =~ m|<P>0x(....) 0x(....)</p>|) { + $first = hex($1); + $second = hex($2); + + push(@key, "$illegal,$first,$second"); + + # printf " {0x%04X, 0x%04X, 0x%04X},\n", $illegal, $first, $second; + } + } + close(FP); + + # $first\x82\xF0\x83L\x81[\x82Ƃ\xB5\x82ă\\x81[\x83g\x82\xB7\x82\xE9 + $k = @key - 1; + while ($k >= 0) { + $j = -1; + for ($i = 1; $i <= $k; $i++) { + @m = split(/,/, $key[$i-1]); + @n = split(/,/, $key[$i]); + if ($m[1] > $n[1]) { + $j = $i - 1; + $t = $key[$j]; + $key[$j] = $key[$i]; + $key[$i] = $t; + } + } + $k = $j; + } + + foreach $s (@key) { + @n = split(/,/, $s); + printf " {0x%04X, 0x%04X, 0x%04X},\n", $n[0], $n[1], $n[2]; + } + +# foreach $key (sort {$a <=> $b} keys %table) { +# @n = split(/,/, $table{$key}); +# printf " {0x%04X, 0x%04X, 0x%04X},\n", $n[0], $key, $n[1]; +# } + +} + Copied: trunk/teraterm/teraterm/unicode/conv_sjis.md (from rev 9185, branches/move_code_script/teraterm/teraterm/unicode/conv_sjis.md) =================================================================== --- trunk/teraterm/teraterm/unicode/conv_sjis.md (rev 0) +++ trunk/teraterm/teraterm/unicode/conv_sjis.md 2021-02-28 08:31:48 UTC (rev 9189) @@ -0,0 +1,22 @@ +# conv_sjis.pl について + +- uni2sjis.map を作るために作成された +- conv_sjis.pl の前は installer/conv.pl だった +- uni2sjis.map は直接人手で修正している + - https://ja.osdn.net/cvs/view/ttssh2/teraterm/source/teraterm/uni2sjis.map?hideattic=0&view=log + - https://ja.osdn.net/projects/ttssh2/svn/view/trunk/teraterm/teraterm/uni2sjis.map?root=ttssh2&view=log +- 現在はこのスクリプトの出力をそのまま使用していない + +## 入力ファイル + +- 最新はこれか? + - ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/SHIFTJIS.TXT +- 作成当時 + - SHIFTJIS_TXT.htm + +## 使い方 + +``` +wget ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/SHIFTJIS.TXT +perl conv_sjis.pl > uni2sjis.map +``` Copied: trunk/teraterm/teraterm/unicode/conv_sjis.pl (from rev 9185, branches/move_code_script/teraterm/teraterm/unicode/conv_sjis.pl) =================================================================== --- trunk/teraterm/teraterm/unicode/conv_sjis.pl (rev 0) +++ trunk/teraterm/teraterm/unicode/conv_sjis.pl 2021-02-28 08:31:48 UTC (rev 9189) @@ -0,0 +1,34 @@ + +# +# Unicode\x82\xF0\x83L\x81[\x82Ƃ\xB5\x82ď\xB8\x8F\x87\x82Ƀ\\x81[\x83g\x82\xB7\x82\xE9 +# + +$file = 'SHIFTJIS.TXT'; + +&read_mapfile($file); +exit(); + +sub read_mapfile { + my($file) = @_; + my(%table, $val, $key); + + open(FP, $file) || die "error"; + while ($line = <FP>) { + if ($line =~ /^\#/) {next;} + if ($line =~ m+^\/+) {next;} + if ($line =~ m+^\<+) {next;} + $line =~ s/^\s+//; + @column = split(/\s+/, $line); + + $val = int(hex($column[1])); # Unicode +# print "$column[0] -> $column[1] ($val)\n"; + $table{$val} = hex($column[0]); +# printf "%d => %x\n", $val, $table{$val}; + } + close(FP); + + foreach $key (sort {$a <=> $b} keys %table) { + printf " { 0x%04X, 0x%04X },\n", $key, $table{$key}; + } +} + Copied: trunk/teraterm/teraterm/unicode/conv_uni.md (from rev 9185, branches/move_code_script/teraterm/teraterm/unicode/conv_uni.md) =================================================================== --- trunk/teraterm/teraterm/unicode/conv_uni.md (rev 0) +++ trunk/teraterm/teraterm/unicode/conv_uni.md 2021-02-28 08:31:48 UTC (rev 9189) @@ -0,0 +1,19 @@ +# conv_uni.pl について + +- sjis2uni.map を作るために作成されたと思われる +- conv_uni.pl の前は installer/rev_conv.pl だった +- sjis2uni.map はソースツリーに存在しないし、使用されていない + +## 入力ファイル + +- 最新はこれか? + - ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/SHIFTJIS.TXT +- 作成当時 + - SHIFTJIS_TXT.htm + +## 使い方 + +``` +wget ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/SHIFTJIS.TXT +perl conv_uni.pl > sjis2uni.map +``` Copied: trunk/teraterm/teraterm/unicode/conv_uni.pl (from rev 9185, branches/move_code_script/teraterm/teraterm/unicode/conv_uni.pl) =================================================================== --- trunk/teraterm/teraterm/unicode/conv_uni.pl (rev 0) +++ trunk/teraterm/teraterm/unicode/conv_uni.pl 2021-02-28 08:31:48 UTC (rev 9189) @@ -0,0 +1,34 @@ + +# +# Shift_JIS\x82\xF0\x83L\x81[\x82Ƃ\xB5\x82ď\xB8\x8F\x87\x82ɏo\x97͂\xB7\x82\xE9 +# + +$file = 'SHIFTJIS_TXT.htm'; + +&read_mapfile($file); +exit(); + +sub read_mapfile { + my($file) = @_; + my(%table, $val, $key); + + open(FP, $file) || die "error"; + while ($line = <FP>) { + if ($line =~ /^\#/) {next;} + if ($line =~ m+^\/+) {next;} + if ($line =~ m+^\<+) {next;} + $line =~ s/^\s+//; + @column = split(/\s+/, $line); + + $val = int(hex($column[0])); # Unicode +# print "$column[0] -> $column[1] ($val)\n"; + $table{$val} = hex($column[1]); +# printf "%d => %x\n", $val, $table{$val}; + } + close(FP); + + foreach $key (sort {$a <=> $b} keys %table) { + printf " { 0x%04X, 0x%04X },\n", $key, $table{$key}; + } +} + Copied: trunk/teraterm/teraterm/unicode/readme.md (from rev 9185, branches/move_code_script/teraterm/teraterm/unicode/readme.md) =================================================================== --- trunk/teraterm/teraterm/unicode/readme.md (rev 0) +++ trunk/teraterm/teraterm/unicode/readme.md 2021-02-28 08:31:48 UTC (rev 9189) @@ -0,0 +1,45 @@ +# 文字コード関連のマップファイル,スクリプトファイルについて + +## [uni_combining.map](../uni_combining.map) + +- NFDで分解されている文字を結合するために使用 +``` + // WideCharToMultiByte() では結合処理は行われない + // 自力で結合処理を行う。ただし、最初の2文字だけ + // 例1: + // U+307B(ほ) + U+309A(゜) は + // Shift jis の 0x82d9(ほ) と 0x814b(゜) に変換され + // 0x82db(ぽ) には変換されない + // 予め U+307D(ぽ)に正規化しておく +``` +- [conv_combining.md](conv_combining.md) + +## [uni2sjis.map](../uni2sjis.map) + +- UnicodeからShift JISに変換するために使用 +- [conv_sjis.md](conv_sjis.md) + +## sjis2uni.map はソースツリーに存在しない + +- Shift JISからUnicodeからに変換できると思われるが、使用されていない +- [conv_uni.md](conv_uni.md) + +## [unisym2decsp.map](../unisym2decsp.map) + +- UnicodeからDEC special文字コードに変換するために使用 + +## [unicode_asian_width.tbl](../unicode_asian_width.tbl) + +- East Asian Width 特性テーブル + - [東アジアの文字幅(wikiepdia)](https://ja.wikipedia.org/wiki/%E6%9D%B1%E3%82%A2%E3%82%B8%E3%82%A2%E3%81%AE%E6%96%87%E5%AD%97%E5%B9%85)参照 +- [get_f_w_a.md](get_f_w_a.md) + +## [unicode_combine.tbl](../unicode_combine.tbl) + +- combine (結合)文字かどうかを調べるテーブル +- [get_combine_table.md](get_combine_table.md) + +## [unicode_emoji.tbl](../unicode_emoji.tbl) + +- 絵文字判定のためのテーブル +- [get_emoji_table.md](get_emoji_table.md)