1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#!/usr/bin/env perl
# $Id: mktestunicode,v 1.3 2002/09/14 21:07:03 euske Exp $
#
# usage: mktestunicode cmap-unicode.src
#
# generate Unicode character table in html.
#
# 2002/2 by 1@2ch
# * public domain *
#
print '<html><body>';
print '<p><strong>Caution! This is incredibly heavy..</strong>';
print '<table><tr><td></td>';
for($i = 0; $i < 16; $i++) {
printf "<td>%x</td>", $i;
}
$c = 0;
$x = 0;
while(<>) {
$x0 = $x;
chop; split; $x = eval($_[0]);
# next if ($x < 256);
$c0 = $c;
$c = $x % 16;
if ($c < $c0 || $x0+15 < $x) {
printf "</tr>\n<tr><td>%04x</td>%s", $x & 0xFFF0, "<td></td>" x $c;
}
print "<td>&#$x;</td>";
}
print "</tr></table></body></html>\n";
|