File: mktestunicode

package info (click to toggle)
xfonts-mona 2.11-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 7,028 kB
  • ctags: 197
  • sloc: perl: 2,600; makefile: 329; lisp: 68
file content (30 lines) | stat: -rwxr-xr-x 638 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl
#
# 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";