5 use open IO => ':utf8';
9 $header{content_type} = 'text/html; charset=utf-8';
11 :><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
12 "http://www.w3.org/TR/html4/loose.dtd">
16 <title>digraph cheat sheet</title>
17 <meta http-equiv="content-type" content="utf-8">
24 border-collapse: collapse;
25 table-layout: fixed; /* prevent resizing, notably in msie6 */
38 width: 1.2em; /* msie only looks at the first row */
39 min-width: 1em; /* prevents gecko from restricting to page width */
45 border: 1px solid #888;
52 td.Lm, td.Mc, td.Me, td.Zl, td.Zp, td.Cs {background:red} /* unknown */
55 td.Greek {background: #FFE0CF}
56 td.Cyrillic {background: #FFDDA8}
57 td.Latin {background: #FFB}
58 td.Hebrew {background: #FFD}
59 td.Arabic {background: #EFE}
60 td.Hiragana {background: #DFC}
61 td.Katakana {background: #DFA}
62 td.Bopomofo {background: #BFC}
65 td.No {background: #FBB} /* number */
66 td.Sc {background: #FCD} /* currency */
67 td.Sm {background: #ECE} /* math */
68 td.So {background: #DDCCFF} /* symbol */
70 td.Po {background: #CDF} /* punctuation */
72 td.Pf {background: #BEF} /* quote */
74 td.Sk {background: #CEE} /* spacing modifier */
75 td.Mn {background: #ACC} /* modifier */
76 td.Cc {background: #BBB; color: #666} /* control */
77 td.Zs {background: #ACB} /* space */
78 td.Zs span {background: #EEE}
80 td.Xa {color: #0A0} /* ascii */
81 td.Xl {color: #070} /* latin1 */
82 td.Co {color: #800} /* private */
83 td.Xz {color: #D00} /* proposed */
92 <h1>RFC-1345 Digraphs</h1>
95 my $di = do 'digraphs.inc.pl';
105 my @chars = ((map {chr} ord '!' .. ord 'Z'), 'a'..'z');
106 splice @chars, $_, 1, () for 2, 3-1, 5-2, 31-3; # remove character exceptions # $ & @
107 my @chars2 = (@chars, '_'); # trailing character (extended set)
110 for my $section (qw{thead tfoot}) {
111 print "<$section><tr><th> ";
112 print "<th>$_" for @chars2;
115 for my $c1 (@chars) {
117 for my $c2 (@chars2) {
118 my $mnem = $c1 . $c2;
119 if (not defined $di->{$mnem}) {
123 my ($codepoint, $name, $prop, $script) = @{ $di->{$mnem} };
125 my $glyph = chr $codepoint;
126 utf8::upgrade($glyph); # prevent latin1 output
127 my $desc = $mnem . ($name && " ($name)");
128 my @class = ('X', grep {$_} $prop, $script);
130 $glyph = quote($glyph);
131 $glyph = "<span>$glyph</span>" if $prop eq 'Zs';
133 printf "\n".'<td class="%s" title="%s">%s',
134 join(' ', @class), quote($desc), $glyph;
142 <td class="X Cc">control
143 <td class="X Zs"><span>spacing</span>
144 <td class="X Mn">modifier
145 <td class="X Sk">spacing modifier
146 <td class="X Pf">quote
147 <td class="X Po">punctuation
148 <td class="X So">symbol
149 <td class="X Sm">math
150 <td class="X Sc">currency
151 <td class="X No">numeric
152 <td class="X Greek">greek
153 <td class="X Cyrillic">cyrillic
154 <td class="X Latin">latin
155 <td class="X Hebrew">hebrew
156 <td class="X Arabic">arabic
157 <td class="X Hiragana">japanese
158 <td class="X Bopomofo">chinese
162 <td class="X">unicode
163 <td class="X Xl">latin1
164 <td class="X Xa">ascii
165 <td class="X Co">private
166 <td class="X Xz">proposed