#!/usr/local/bin/perl # Copyright (C)1995-2001 ASH multimedia lab. (http://ash.or.jp/) # # create code table (Big5) # # 繁体中国語(Big5)文字コード表の作成 open (OUT, "> big5tbl.htm"); select OUT; # ファイルヘッダの表示 print <<_EOD;
_EOD
# 文字コード表の作成
for ($c1 = 0xA1; $c1 <= 0xF9; $c1++) { # $c1は第1バイト
# スケールの表示
print "\ncode ";
print "+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F\n";
$head = "";
$line = "";
$c = 1; # 1行文字数(16文字)
for ($c2 = 0x40; $c2 <= 0xFF; $c2++) { # $c2は第2バイト
# ヘッダ(文字コード)の表示
if ("$head" eq "") {
$head = sprintf ("%02X%02X ", $c1, $c2);
}
# 文字の表示
$line .= " "; # 文字間の空白
if (($c2 == 0x7F) || ($c2 == 0xA0) || ($c2 == 0xFF)) {
$line .= ' ';
} else {
$line .= pack("CC", $c1, $c2);
}
if ($c == 16) { # 16文字目で1行表示
print "$head$line\n";
$head = "";
$line = "";
$c = 1;
if ($c2 == 0x7F) { $c2 = 0x9F; }
} else {
$c++;
}
}
}
# ファイルフッタの表示
print <<_EOD;