charset: hexadecimal subselect options
[sheet.git] / charset.plp
1 <(common.inc.plp)><:
2
3 Html({
4         title => 'charset cheat sheet',
5         version => '1.0',
6         description => [
7                 "Reference sheet with all glyphs in common character encoding tables,",
8                 "and an overview of Unicode ranges and UTF-8 bytes.",
9         ],
10         keywords => [qw'
11                 charset codepage unicode ascii utf8 latin glyph character encoding
12                 reference common overview table
13         '],
14         stylesheet => [qw'light'],
15         data => [qw'charset-unicode.inc.pl charset-ucplanes.inc.pl charset-utf8.inc.pl'],
16 });
17
18 my @tablist = split m{/+}, $Request || 'default';
19
20 use List::Util qw( first pairmap pairfirst pairs );
21
22 :>
23 <h1>Character encodings</h1>
24
25 <p>
26 <:
27 if ($tablist[0] eq 'default') {
28         say "Overview of Unicode allocation and common latin code pages.";
29         say "Compare alternate charsets:";
30 }
31 else {
32         say "Charset comparison:";
33 }
34
35 sub optionlink {
36         my ($title, $href, $selected) = @_;
37         return sprintf(
38                 $selected ? '<strong>%s</strong>' : '<a href="%2$s">%s</a>',
39                 EscapeHTML($title), $href
40         );
41 }
42
43 print join " •\n", (
44         map {
45                 join " ·\n", pairmap {
46                         optionlink($b || ucfirst $a, '/charset'.($a && "/$a?compare"), $a eq $Request);
47                 } @{$_}
48         }
49         [
50                 iso      => 'ISO',
51                 win      => 'Windows',
52                 dos      => 'DOS',
53                 mac      => 'Apple',
54                 ebcdic   => 'EBCDIC',
55                 $tablist[0] eq 'default' ? () : ('' => 'common'),
56         ],
57         [
58                 westeur  => 'West',
59                 centeur  => 'Central',
60                 norteur  => 'North European',
61                 turkish  => 0,
62                 greek    => 0,
63                 cyrillic => 0,
64                 hebrew   => 0,
65         ],
66 );
67 :>.
68 </p>
69
70 <:
71 use POSIX qw( ceil );
72 use Shiar_Sheet::FormatChar;
73 my $glyphs = Shiar_Sheet::FormatChar->new;
74 my @request;
75
76 sub tabinput {
77         # generate character table(s)
78         my $input = shift or return;
79
80         state $ALIAS = {
81                 default    => [qw( u+0-27F utf-8+realsize iso-8859-1 iso-8859-15 cp1252 cp437 cp850 )],
82                 unicode    => [qw( uu+cols=32+realsize u+0-FFF u+1000-18AF u+18B0-1FFF )],
83                 us         => [qw( cp437 cp863 gsm0338 AdobeStandardEncoding )],
84                 ebcdic     => [qw( cp37 cp500 cp1047 posix-bc cp1026 cp875 )],
85                 iso        => [map {"iso-8859-$_"} 1 .. 11, 13 .. 16],
86                 dos        => [qw( cp437 cp865 cp861 cp860 cp863 cp850 cp857 cp852 cp775
87                                    cp737 cp869 cp866 cp855 cp862 cp864 )],
88                 aix        => [qw( cp1006 )],
89                 win        => [qw( cp1252 cp1250 cp1254 cp1257 cp1258 cp1253 cp1251 cp1255 cp1256 cp874 )],
90                 mac        => [qw( MacRoman MacRomanian MacRumanian MacCroatian MacCentralEurRoman MacTurkish MacIcelandic MacSami
91                                    MacGreek MacCyrillic MacHebrew MacArabic MacFarsi MacThai )],
92
93                 # languages
94                 westeur    => [qw( iso-8859-1 iso-8859-15 cp1252 iso-8859-14 cp850 hp-roman8 nextstep MacRoman )],
95                 centeur    => [qw( iso-8859-2 iso-8859-16 cp1250 cp852 MacRomanian MacCroatian MacCentralEurRoman )], # MacRumanian only for DB
96                 turkish    => [qw( iso-8859-9 iso-8859-3 cp1254 cp857 MacTurkish )],
97                 norteur    => [qw( baltic nordic )],
98                 baltic     => [qw( iso-8859-4 iso-8859-13 cp1257 cp775 )],
99                 nordic     => [qw( iso-8859-10 cp865 cp861 MacIcelandic MacSami )],
100                 cyrillic   => [qw( koi8-r koi8-u koi8-f iso-8859-5 cp1251 MacCyrillic cp866 cp855
101                                    U4 U2DE-2DF UA64-A69 U50-52 )], # MacUkrainian is broken
102                 arabic     => [qw( iso-8859-6 cp1256 MacArabic cp864 cp1006 MacFarsi
103                                    U6 U8A-8F+0-1F+40 U75-77 )],
104                 greek      => [qw( iso-8859-7 cp1253 MacGreek cp737 cp869  U37-3F U1F )],
105                 hebrew     => [qw( iso-8859-8 cp1255 MacHebrew cp862  U59-5F )],
106                 thai       => [qw( iso-8859-11 cp874 MacThai )],
107                 vietnamese => [qw( viscii cp1258 MacVietnamese )],
108                 symbols    => [qw( symbol dingbats MacDingbats wingdings wingdings2 wingdings3 webdings )],
109
110                 # iso-code shorthand
111                 1 => 'westeur',
112                 2 => 'centeur',
113                 3 => 'turkish',
114                 4 => 'baltic',
115                 5 => 'cyrillic',
116                 6 => 'arabic',
117                 7 => 'greek',
118                 8 => 'hebrew',
119                 9 => 'turkish',
120                 10 => 'nordic',
121                 11 => 'thai',
122         };
123         if (my $follow = $ALIAS->{$input}) {
124                 tabinput($_) for ref $follow ? @{$follow} : $follow;
125                 return;
126         }
127
128         state $visible = {'' => 1};  # all present tables
129         my %row = (offset => 0, cols => 16);
130         my $params = $input =~ s/[+](.*)\z// ? $1 : undef;
131
132         if (not defined $params) {
133                 state $INHERIT = {
134                         'ascii'       => ['' => '00-7F'],
135                         'cp437'       => ['cp850' => 0, 'ascii' => '00-1F+80'], # ascii range overridden later
136                         'gsm0338'     => ['ascii' => '00-7F'],
137                         'dingbats'    => ['' => '20-7F+A0'],
138                         'MacDingbats' => ['dingbats' => '80-9F'],
139                         'AdobeZdingbat'=> ['MacDingbats' => '80-9F'], # should be identical but maps to private use
140                         'symbol'      => ['' => '20-7F+A0'],
141                         'AdobeSymbol' => ['symbol' => '20-7F+A0', '' => '20-7F+A0'], # minor differences, irrelevant except for different '€'
142                         'wingdings'   => ['' => '20'],
143                         'wingdings2'  => ['' => '20'],
144                         'wingdings3'  => ['' => '20'],
145                         'webdings'    => ['' => '20'],
146
147                         'iso-8859-2'  => ['iso-8859-1' => 'A0'],
148                         'iso-8859-3'  => ['iso-8859-1' => 'A0'], #TODO: also apply to iso-8859-9
149                         'iso-8859-4'  => ['iso-8859-2' => 'A0'],
150                         'iso-8859-5'  => ['iso-8859-1' => 'A0'],
151                         'iso-8859-6'  => ['cp1256' => '80', 'iso-8859-1' => 'A0'],
152                         'iso-8859-7'  => ['iso-8859-1' => 'A0'],
153                         'iso-8859-8'  => ['iso-8859-1' => 'A0'],
154                         'iso-8859-9'  => ['iso-8859-1' => 'D0-DF+F0'],
155                         'iso-8859-10' => ['iso-8859-4' => 'A0'],
156                         'iso-8859-11' => ['iso-8859-1' => 'A0'],
157                         'iso-8859-13' => ['iso-8859-4' => 'A0'],
158                         'iso-8859-14' => ['iso-8859-1' => 'A0'],
159                         'iso-8859-15' => ['iso-8859-1' => 'A0-BF'],
160                         'iso-8859-16' => ['iso-8859-2' => 'A0'],
161                         'hp-roman8'   => ['iso-8859-1' => 'A0'],
162
163                         'cp1252'      => ['iso-8859-1' => '80-9F'],
164                         'cp1250'      => ['iso-8859-2' => '80-BF', 'cp1252' => '80'],
165                         'cp1254'      => ['iso-8859-9' => '80-9F', 'cp1252' => '80-9F+D0'],
166                         'cp874'       => ['iso-8859-11' => '80-9F', 'cp1252' => '80'], # windows-874 actually cp1162
167                         'cp1257'      => ['iso-8859-13' => '80-9F+FF', 'cp1252' => '80'],
168                         'cp1251'      => ['cp1252' => '80'],
169                         'cp1253'      => ['cp1252' => '80'],
170                         'cp1255'      => ['iso-8859-8' => '80-DF', 'cp1252' => '80'],
171                         'cp1256'      => ['cp1252' => '80'],
172                         'cp1258'      => ['cp1252' => '80-9F+C0'],
173
174                         'cp850'       => ['cp437' => '90'],
175                         'cp860'       => ['cp437' => '80-AF'],
176                         'cp861'       => ['cp865' => '80-AF'],
177                         'cp863'       => ['cp437' => '80-AF'],
178                         'cp865'       => ['cp437' => '90-AF'],
179                         'cp852'       => ['cp850' => '80', 'cp437' => '80'],
180                         'cp857'       => ['cp850' => '80-AF+D0-EF', 'cp437' => '80'],
181                         'cp775'       => ['cp850' => '80'],  # partial cp437
182                         'cp866'       => ['cp437' => '80-AF+E0'],
183                         'cp855'       => ['cp437' => '80'],
184                         'cp1006'      => ['iso-8859-6' => 'A0', 'cp437' => '80'],
185                         'cp737'       => ['cp437' => '80-AF+E0'],
186                         'cp869'       => ['cp437' => '80'],
187                         'cp862'       => ['cp437' => '80-9F'],
188                         'cp864'       => ['MacArabic' => '80', 'iso-8859-6' => '80', 'cp437' => '80'], #TODO: compare form variants
189
190                         'koi8-u'      => ['koi8-r' => '90-BF'],
191                         'koi8-f'      => ['koi8-u' => '90-BF'],
192
193                         'MacRomanian' => ['MacRoman' => 'A0-BF+D0-DF'],
194                         'MacRumanian' => ['MacRomanian' => 'A0-BF+D0-DF', 'MacRoman' => 'A0-BF+D0-DF'],
195                         'MacCroatian' => ['MacRoman' => 'A0'],
196                         'MacCentralEurRoman' => ['MacRoman' => '80'],
197                         'MacIcelandic'=> ['MacRoman' => 'A0-AF+D0-EF'],
198                         'MacTurkish'  => ['MacRoman' => 'D0-DF'], # F5 is unassigned
199                         'MacSami'     => ['MacIcelandic' => '90-BF+D0-DF+F0', 'MacRoman' => '90'],
200                         'MacGreek'    => ['MacRoman' => '80'],
201                         'MacCyrillic' => ['MacRoman' => '80'],
202                         'MacHebrew'   => ['iso-8859-8' => '80', 'MacRoman' => '80-8F+A0'], # partial ascii
203                         'MacArabic'   => ['iso-8859-6' => '80', 'cp864' => '80', 'MacRoman' => '80'], #TODO: multiple parents
204                         'MacFarsi'    => ['MacArabic' => 'B0-BF', 'MacRoman' => '80'],
205
206                         'cp37'        => ['posix-bc' => '00'],
207                         'posix-bc'    => ['cp1047' => '40'],
208                         'cp500'       => ['cp37' => '40-5F+B0-BF'],
209                         'cp1047'      => ['cp37' => '10-2F+50-5F+A0-BF'],
210                         'cp1026'      => ['cp37' => '40'],
211                         'cp875'       => ['cp37' => '30'],
212
213                 };
214
215                 my @parents = @{ $INHERIT->{$input} || [] };
216
217                 if (my ($parent, $part) = pairfirst { defined $visible->{$a} } @parents) {
218                         $row{parent} = $parent;
219                         $params = $part;
220                         $params = 80 unless $visible->{$parent}
221                                 or ($input eq 'MacCroatian' and defined $visible->{MacRomanian});
222                 }
223                 elsif (defined $visible->{ascii}) {
224                         $row{parent} = $parents[0];
225                         $params = $parents[1] // 80;
226                         $params = 80 if hex $params >= 128;  # ascii offset at most
227                 }
228                 elsif (@parents) {
229                         $row{parent} = $parents[0];
230                         $params = $parents[1] if hex $parents[1] == 0;  # apply ascii end
231                 }
232                 $visible->{$_} //= 0 for $row{parent} || ();
233         }
234
235         for my $param (split /[+]+/, $params // '') {
236                 if ($param eq 'realsize') {
237                         $row{realsize}++;
238                 }
239                 elsif ($param =~ m{ \A cols = (\d+) \z }x) {
240                         $row{cols} = $1;
241                 }
242                 elsif ($param =~ m{ \A (?<start> \p{AHex}+) (?: [-] (?<end> \p{AHex}+) )? \z }x) {
243                         if (defined $row{endpoint}) {
244                                 # extend earlier range
245                                 my $skip = int(($row{endpoint} || $row{startpoint}) / $row{cols});
246                                 for ($skip + 1 .. (hex($+{start}) / $row{cols}) - 1) {
247                                         $row{skip}->{ $_ * $row{cols} - $row{startpoint} }++;
248                                 }
249                         }
250                         else {
251                                 $row{startpoint} = hex $+{start};
252                         }
253                         $row{endpoint} = hex($+{end} || 0);
254                 }
255                 else {
256                         Alert("Unknown option <q>$param</q> for charset $input");
257                 }
258         }
259
260         if ($input =~ m{ \A (?:wing|web)dings \d* \z }ix) {
261                 eval "require Encode::\u$input";
262         }
263
264         if ($input =~ m{ \A u ([0-9a-f]+) (?:-([0-9a-f]+))? \z }ix) {
265                 my $start = hex($1) << ($2 ? 4 : 8);
266                 my $end = $2 ? (hex($2) << 4) + $row{cols} - 1 : $start + 255;
267                 $row{table} = join '', map { chr } $start .. $end;
268                 utf8::upgrade($row{table});  # prevent latin1 output
269                 $row{endpoint} = $end - $start;
270                 $row{set} = sprintf 'Unicode block U+%02Xxx', $start >> 8;
271                 $row{offset} = $start % 256;
272                 $row{startpoint} = 0;
273         }
274         elsif (lc $input eq 'uu') {
275                 $row{set} = 'Unicode planes';
276                 $row{cell} = do 'charset-ucplanes.inc.pl'
277                         or Alert('Table data could not be read', $@ || $!);
278                 $row{endpoint} ||= 1023;
279         }
280         elsif (lc $input eq 'u') {
281                 $row{cell} = do 'charset-unicode.inc.pl'
282                         or Alert('Table data could not be read', $@ || $!);
283
284                 $row{endpoint} ||= 8191;
285                 $row{set} = 'Unicode ' . (
286                         $row{startpoint} <  0x1000 && $row{endpoint} < 0x1000 ? 'BMP' :
287                         $row{startpoint} >= 0x1000 && $row{endpoint} < 0x2000 ? 'SMP' :
288                         'allocations'
289                 );
290         }
291         elsif ($input =~ m/^utf-*8$/i) {
292                 $row{set} = 'UTF-8';
293                 $row{cell} = do 'charset-utf8.inc.pl'
294                         or Alert('Table data could not be read', $@ || $!);
295                 $row{endpoint} = 255;
296         }
297         elsif ($row{set} = Encode::resolve_alias($input)) {
298                 $row{offset} = delete $row{startpoint};
299                 $row{endpoint} ||= 255;
300                 if ($row{set} eq 'MacHebrew' or $row{set} eq 'MacThai') {
301                         # array of possibly multiple characters per code point
302                         $row{table} = [
303                                 map { Encode::decode($row{set}, pack 'C*', $_) } $row{offset} .. $row{endpoint}
304                         ];
305                 }
306                 else {
307                         # ~16x faster than decoding in loop;
308                         # substr strings is twice as fast as splitting to an array
309                         $row{table} = Encode::decode($row{set}, pack 'C*', $row{offset} .. $row{endpoint});
310                 }
311
312                 if ($row{set} eq 'cp437') {
313                         if ($row{offset} <= 0xED and $row{endpoint} >= 0xED) {
314                                 # replace phi glyph
315                                 substr($row{table}, 0xED - $row{offset}, 1) = 'ϕ';
316                         }
317                         if ($row{offset} < 0x20) {
318                                 # replace control characters by visible variants
319                                 my $sub = substr ' ☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼', $row{offset};
320                                 substr($row{table}, 0, length $sub) = $sub;
321                         }
322                 }
323                 elsif ($row{set} eq 'symbol') {
324                         if ($row{offset} <= 0x60 and $row{endpoint} >= 0x60) {
325                                 # replace radical extender by closest unicode equivalent
326                                 substr($row{table}, 0x60 - $row{offset},  1) = '│';
327                         }
328                         if ($row{offset} <= 0xBD and $row{endpoint} >= 0xFF) {
329                                 substr($row{table}, 0xBD - $row{offset},  2) = '⏐⎯'; # arrow extenders
330                                 substr($row{table}, 0xD2 - $row{offset},  3) = '®©™'; # serif variants
331                                 substr($row{table}, 0xE0 - $row{offset},  1) = '◊'; # replace lookalike, should match AdobeSymbol
332                                 substr($row{table}, 0xE2 - $row{offset},  3) = '®©™'; # sans-serif variants
333                                 substr($row{table}, 0xE6 - $row{offset}, 10) = '⎛⎜⎝⎡⎢⎣⎧⎨⎩⎪';
334                                 substr($row{table}, 0xF0 - $row{offset},  1) = '€';
335                                 substr($row{table}, 0xF4 - $row{offset}, 11) = '⎮⌡⎞⎟⎠⎤⎥⎦⎫⎬⎭';
336                         }
337                 }
338
339                 $row{endpoint} -= $row{offset};
340
341                 $visible->{ascii} =  # assume common base
342                 $visible->{ $row{set} } = 1;
343         }
344         else {
345                 Alert("Encoding <q>$input</q> unknown");
346                 return;
347         }
348         push @request, \%row;
349 }
350 tabinput($_) for @tablist;
351
352 my $NOCHAR = chr 0xFFFD;
353
354 sub range_cell {
355         my ($info, $offset) = @_;
356         my $table = $info->{cell} or return;
357         my $def = $table->{$offset} or return;
358         my ($len, $class, $name, $title) = @{$def};
359
360         my $cols = $info->{cols};
361         my $colsize = $table->{colsize} || 1;
362         my $attr = '';
363         $len /= $colsize;
364         $name //= $len <= 2 ? 'res' : 'reserved';
365
366         if (my $part = ($offset/$colsize - $info->{startpoint}) % $cols) {
367                 # continued row
368                 my $rest = $cols - $part;  # remaining
369                 $rest = $len if $len < $rest; #TODO: optimise
370                 if ($len -= $rest) {
371                         # continued on new row
372                         my @next = ($len * $colsize, "$class joinu");
373                         my $separate = $cols - $len > $rest;  # columns not on next row
374                         if ($len > $rest) {
375                                 # minority remains
376                                 push @next, $name, $title;
377                                 $title ||= $name;
378                                 $name = $separate && '…';
379                         }
380                         else {
381                                 # minority on next row
382                                 push @next, $separate && '"', $title || $name;
383                         }
384                         $table->{$offset + $colsize*$rest} //= \@next;
385                         $class .= ' joind';
386                 }
387                 $len = $rest;
388         }
389         elsif (my $rows = int($len / $cols)) {
390                 # multiple full rows
391                 my $rowsize = $colsize * $cols;
392                 if ($len -= $rows * $cols) {
393                         # partial row remains
394                         $table->{$offset + $rowsize * $rows} //= [$len*$colsize, "$class joinu", '', $title];
395                         $class .= ' joind';
396                 }
397
398                 unless ($info->{realsize}) {
399                         # coalesce multiple rows
400                         while ($rows > 3) {
401                                 $info->{skip}->{$offset += $rowsize}++;
402                                 $rows--;
403                         }
404                         if ($rows > 2) {
405                                 $info->{skip}->{$offset += $rowsize} = 0;
406                         }
407                 }
408
409                 $attr .= sprintf ' rowspan=%d', $rows;
410                 $len = $cols;
411         }
412
413         $attr .= sprintf ' colspan=%d', $len unless $len == 1;
414         $attr .= $1 if $class and $class =~ s/( \w+="[^"]*")//;
415         $attr .= sprintf ' class="%s"', $class if $class;
416         $attr .= sprintf ' title="%s"', EscapeHTML($title) if $title;
417         return "<td$attr>$name\n";
418 }
419
420 for my $row (@request) {
421         my $cols = $row->{cols};
422         my $colsize = $row->{cell} && $row->{cell}->{colsize} || 1;
423         my $coldigits = ceil(log($colsize * $cols) / log(16));  # uniform length of hexadecimal header
424         my $rowdiv = 16 ** $coldigits;  # row divide for column digits
425         $rowdiv = 1 if $rowdiv != $cols * $colsize;  # divide only if all columns are matched
426         my $offset = $row->{startpoint} * $colsize || 0;
427
428         printf '<div class="section"><table class="glyphs%s">', !$row->{cell} && ' charmap';
429         my $title = $row->{set};
430         $title .= " <aside>(over $_)</aside>"
431                 for $row->{parent} || ();
432         printf '<caption>%s</caption>', $title;
433         print '<col>' x ($cols + 1);
434         for my $section (qw{thead}) {
435                 print "<$section><tr><th>", $rowdiv == 1 ? '+' : '↱';
436                 printf '<th>%0*X', $coldigits, $_ * $colsize for 0 .. $cols - 1;
437                 print "\n";
438         }
439
440         print '<tbody>';
441         while ($offset <= $row->{endpoint} * $colsize) {
442                 if ($row->{skip}->{$offset}) {
443                         $offset += $cols * $colsize;
444                         next;
445                 }
446
447                 print '<tr><th>';
448                 if (defined $row->{skip}->{$offset}) {
449                         print '⋮';
450                 }
451                 else {
452                         if (my $rowmod = $offset % $rowdiv) {
453                                 # offset in column units
454                                 printf '<small>+%X</small>', $rowmod;
455                         }
456                         else {
457                                 # divided row offset
458                                 printf '%X', ($offset + $row->{offset}) / $rowdiv;
459                         }
460                 }
461                 say '';
462
463                 for (1 .. $cols) {
464                         if ($row->{cell}) {
465                                 print range_cell($row, $offset);
466                                 next;
467                         }
468
469                         my $cp = $offset + $row->{offset};
470                         my $glyph = ref $row->{table} eq 'ARRAY' ? $row->{table}->[$offset] :
471                                 substr $row->{table}, $offset, 1;
472                         my ($cell, $name, $class) = $glyph eq $NOCHAR ? () :
473                                 $glyphs->glyph_html($glyph);
474
475                         if (exists $get{compare}) {
476                                 state $visible = {};
477                                 $class = (
478                                         $cp == ord $glyph ? 'l4' :
479                                         $row->{parent} && $glyph eq
480                                                 Encode::decode($row->{parent}, pack 'C', $cp) ? 'l3' :
481                                         !$class ? undef :
482                                         $visible->{$glyph} ? 'l2' :
483                                         'l1'
484                                 );
485                                 $visible->{$glyph}++;
486                         }
487
488                         say sprintf $class ? '<td title="%s" class="X %s">%s' : '<td title="%s">',
489                                 $name, $class, $cell;
490                 }
491                 continue {
492                         $offset += $colsize;
493                 }
494         }
495         say '</table></div>';
496 }
497
498 :>
499 <hr>
500
501 <div class="legend">
502         <table class="glyphs"><tr><: if (exists $get{compare}) { :>
503         <td class="X l4">unicode
504         <td class="X l3">inherited
505         <td class="X l2">existing
506         <td class="X l1">original
507         <td class="">unassigned
508 <: } else { :>
509         <td class="X Cc">control
510         <td class="X Zs"><span>whitespace</span>
511         <td class="X Mn">diacritic<table class="glyphs"><tr>
512                 <td class="X Sk">letter
513                 </table>
514         <td class="X Po">punctuation<table class="glyphs"><tr>
515                 <td class="X Pf">quote
516                 </table>
517         <td class="X So">symbol<table class="glyphs"><tr>
518                 <td class="X Sm">math
519                 <td class="X Sc">currency
520                 </table>
521         <td class="X No">numeric
522         <td class="X Greek">greek<table class="glyphs"><tr>
523                 <td class="X Latin">latin
524                 <td class="X Cyrillic">cyrillic
525                 </table>
526         <td class="X Aramaic">aramaic<table class="glyphs"><tr>
527                 <td class="X Brahmic">brahmic
528                 <td class="X Arabic">arabic
529                 </table>
530         <td class="X Syllabic">syllabic<table class="glyphs"><tr>
531                 <td class="X African">african
532                 <td class="X Hiragana">japanese
533                 <td class="X Han">cjk
534                 <td class="X Bopomofo">chinese
535                 </table>
536         <td class="X Alpha">alphabetic
537         </table>
538
539         <table class="glyphs"><tr>
540         <td class="X">unicode 7.0
541         <td class="X Xr">proposed
542         <td class="X Xd">deprecated
543         <td class="">unassigned
544         <td class="X Xi">invalid
545 <: } :> </table>
546 </div>
547