Revision: 9185 https://osdn.net/projects/ttssh2/scm/svn/commits/9185 Author: nmaya Date: 2021-02-25 23:29:30 +0900 (Thu, 25 Feb 2021) Log Message: ----------- スクリプトファイルの説明を修正 Modified Paths: -------------- branches/move_code_script/teraterm/teraterm/unicode/readme.md Added Paths: ----------- branches/move_code_script/teraterm/teraterm/unicode/conv_uni.md branches/move_code_script/teraterm/teraterm/unicode/conv_uni.pl Removed Paths: ------------- branches/move_code_script/teraterm/teraterm/unicode/rev_conv.pl -------------- next part -------------- Added: branches/move_code_script/teraterm/teraterm/unicode/conv_uni.md =================================================================== --- branches/move_code_script/teraterm/teraterm/unicode/conv_uni.md (rev 0) +++ branches/move_code_script/teraterm/teraterm/unicode/conv_uni.md 2021-02-25 14:29:30 UTC (rev 9185) @@ -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: branches/move_code_script/teraterm/teraterm/unicode/conv_uni.pl (from rev 9184, branches/move_code_script/teraterm/teraterm/unicode/rev_conv.pl) =================================================================== --- branches/move_code_script/teraterm/teraterm/unicode/conv_uni.pl (rev 0) +++ branches/move_code_script/teraterm/teraterm/unicode/conv_uni.pl 2021-02-25 14:29:30 UTC (rev 9185) @@ -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}; + } +} + Modified: branches/move_code_script/teraterm/teraterm/unicode/readme.md =================================================================== --- branches/move_code_script/teraterm/teraterm/unicode/readme.md 2021-02-24 16:01:45 UTC (rev 9184) +++ branches/move_code_script/teraterm/teraterm/unicode/readme.md 2021-02-25 14:29:30 UTC (rev 9185) @@ -2,8 +2,7 @@ ## [uni_combining.map](../uni_combining.map) -- [conv_combining.md](conv_combining.md) -- ANSIに変換する前に使用 +- NFDで分解されている文字を結合するために使用 ``` // WideCharToMultiByte() では結合処理は行われない // 自力で結合処理を行う。ただし、最初の2文字だけ @@ -13,6 +12,7 @@ // 0x82db(ぽ) には変換されない // 予め U+307D(ぽ)に正規化しておく ``` +- [conv_combining.md](conv_combining.md) ## [uni2sjis.map](../uni2sjis.map) @@ -19,6 +19,11 @@ - 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文字コードに変換するために使用 Deleted: branches/move_code_script/teraterm/teraterm/unicode/rev_conv.pl =================================================================== --- branches/move_code_script/teraterm/teraterm/unicode/rev_conv.pl 2021-02-24 16:01:45 UTC (rev 9184) +++ branches/move_code_script/teraterm/teraterm/unicode/rev_conv.pl 2021-02-25 14:29:30 UTC (rev 9185) @@ -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}; - } -} -