charset: support start and end parameters for unicode planes
[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-639 utf-8+realsize iso-8859-1 iso-8859-15 cp1252 cp437 cp850 )],
82                 unicode    => [qw( uu+cols=32+realsize u+0-4095 u+4096-6319 u+6320-8191 )],
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-31+64 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                         'cp437'       => ['cp850' => 0, 'ascii' => '0-31+128'], # ascii range overridden later
135                         'gsm0338'     => ['ascii' => '0-127'],
136                         'dingbats'    => ['' => '32-127+160'],
137                         'MacDingbats' => ['dingbats' => '128-159'],
138                         'AdobeZdingbat'=> ['MacDingbats' => '128-159'], # should be identical but maps to private use
139                         'symbol'      => ['' => '32-127+160'],
140                         'AdobeSymbol' => ['symbol' => '32-127+160', '' => '32-127+160'], # minor differences, irrelevant except for different '€'
141                         'wingdings'   => ['' => '32'],
142                         'wingdings2'  => ['' => '32'],
143                         'wingdings3'  => ['' => '32'],
144                         'webdings'    => ['' => '32'],
145
146                         'iso-8859-2'  => ['iso-8859-1' => '160'],
147                         'iso-8859-3'  => ['iso-8859-1' => '160'], #TODO: also apply to iso-8859-9
148                         'iso-8859-4'  => ['iso-8859-2' => '160'],
149                         'iso-8859-5'  => ['iso-8859-1' => '160'],
150                         'iso-8859-6'  => ['cp1256' => '128', 'iso-8859-1' => '160'],
151                         'iso-8859-7'  => ['iso-8859-1' => '160'],
152                         'iso-8859-8'  => ['iso-8859-1' => '160'],
153                         'iso-8859-9'  => ['iso-8859-1' => '208-223+240'],
154                         'iso-8859-10' => ['iso-8859-4' => '160'],
155                         'iso-8859-11' => ['iso-8859-1' => '160'],
156                         'iso-8859-13' => ['iso-8859-4' => '160'],
157                         'iso-8859-14' => ['iso-8859-1' => '160'],
158                         'iso-8859-15' => ['iso-8859-1' => '160-191'],
159                         'iso-8859-16' => ['iso-8859-2' => '160'],
160                         'hp-roman8'   => ['iso-8859-1' => '160'],
161
162                         'cp1252'      => ['iso-8859-1' => '128-159'],
163                         'cp1250'      => ['iso-8859-2' => '128-191', 'cp1252' => '128'],
164                         'cp1254'      => ['iso-8859-9' => '128-159', 'cp1252' => '128-159+208'],
165                         'cp874'       => ['iso-8859-11' => '128-159', 'cp1252' => '128'], # windows-874 actually cp1162
166                         'cp1257'      => ['iso-8859-13' => '128-159+255', 'cp1252' => '128'],
167                         'cp1251'      => ['cp1252' => '128'],
168                         'cp1253'      => ['cp1252' => '128'],
169                         'cp1255'      => ['iso-8859-8' => '128-223', 'cp1252' => '128'],
170                         'cp1256'      => ['cp1252' => '128'],
171                         'cp1258'      => ['cp1252' => '128-159+192'],
172
173                         'cp850'       => ['cp437' => '144'],
174                         'cp860'       => ['cp437' => '128-175'],
175                         'cp861'       => ['cp865' => '128-175'],
176                         'cp863'       => ['cp437' => '128-175'],
177                         'cp865'       => ['cp437' => '144-175'],
178                         'cp852'       => ['cp850' => '128', 'cp437' => '128'],
179                         'cp857'       => ['cp850' => '128-175+208-239', 'cp437' => '128'],
180                         'cp775'       => ['cp850' => '128'],  # partial cp437
181                         'cp866'       => ['cp437' => '128-175+224'],
182                         'cp855'       => ['cp437' => '128'],
183                         'cp1006'      => ['iso-8859-6' => '160', 'cp437' => '128'],
184                         'cp737'       => ['cp437' => '128-175+224'],
185                         'cp869'       => ['cp437' => '128'],
186                         'cp862'       => ['cp437' => '128-159'],
187                         'cp864'       => ['MacArabic' => '128', 'iso-8859-6' => '128', 'cp437' => '128'], #TODO: compare form variants
188
189                         'koi8-u'      => ['koi8-r' => '144-191'],
190                         'koi8-f'      => ['koi8-u' => '144-191'],
191
192                         'MacRomanian' => ['MacRoman' => '160-191+208-223'],
193                         'MacRumanian' => ['MacRomanian' => '160-191+208-223', 'MacRoman' => '160-191+208-223'],
194                         'MacCroatian' => ['MacRoman' => '160'],
195                         'MacCentralEurRoman' => ['MacRoman' => '128'],
196                         'MacIcelandic'=> ['MacRoman' => '160-175+208-239'],
197                         'MacTurkish'  => ['MacRoman' => '208-223'], # F5 is unassigned
198                         'MacSami'     => ['MacIcelandic' => '144-191+208-223+240', 'MacRoman' => '144'],
199                         'MacGreek'    => ['MacRoman' => '128'],
200                         'MacCyrillic' => ['MacRoman' => '128'],
201                         'MacHebrew'   => ['iso-8859-8' => '128', 'MacRoman' => '128-143+160'], # partial ascii
202                         'MacArabic'   => ['iso-8859-6' => '128', 'cp864' => '128', 'MacRoman' => '128'], #TODO: multiple parents
203                         'MacFarsi'    => ['MacArabic' => '176-191', 'MacRoman' => '128'],
204
205                         'cp37'        => ['posix-bc' => '0'],
206                         'posix-bc'    => ['cp1047' => '64'],
207                         'cp500'       => ['cp37' => '64-95+176-191'],
208                         'cp1047'      => ['cp37' => '16-47+80-95+160-191'],
209                         'cp1026'      => ['cp37' => '64'],
210                         'cp875'       => ['cp37' => '48'],
211
212                 };
213
214                 my @parents = @{ $INHERIT->{$input} || [] };
215
216                 if (my ($parent, $part) = pairfirst { defined $visible->{$a} } @parents) {
217                         $row{parent} = $parent;
218                         $params = $part;
219                         $params = 128 unless $visible->{$parent}
220                                 or ($input eq 'MacCroatian' and defined $visible->{MacRomanian});
221                 }
222                 elsif (defined $visible->{ascii}) {
223                         $row{parent} = $parents[0];
224                         $params = $parents[1] // 128;
225                         $params = 128 if $params >= 128;  # ascii offset at most
226                 }
227                 elsif (@parents) {
228                         $row{parent} = $parents[0];
229                         $params = $parents[1] if $parents[1] == 0;  # apply ascii end
230                 }
231                 $visible->{$_} //= 0 for $row{parent} || ();
232         }
233
234         for my $param (split /[+]+/, $params // '') {
235                 if ($param eq 'realsize') {
236                         $row{realsize}++;
237                 }
238                 elsif ($param =~ m{ \A cols = (\d+) \z }x) {
239                         $row{cols} = $1;
240                 }
241                 elsif ($param =~ m{ \A (?<start> \d+) (?: [-] (?<end> \d+) )? \z }x) {
242                         if (defined $row{endpoint}) {
243                                 # extend earlier range
244                                 my $skip = int(($row{endpoint} || $row{startpoint}) / $row{cols});
245                                 for ($skip + 1 .. ($+{start} / $row{cols}) - 1) {
246                                         $row{skip}->{ $_ * $row{cols} - $row{startpoint} }++;
247                                 }
248                         }
249                         else {
250                                 $row{startpoint} = $+{start};
251                         }
252                         $row{endpoint} = $+{end} || 0;
253                 }
254                 else {
255                         Alert("Unknown option <q>$param</q> for charset $input");
256                 }
257         }
258
259         if ($input =~ m{ \A (?:wing|web)dings \d* \z }ix) {
260                 eval "require Encode::\u$input";
261         }
262
263         if ($input =~ m{ \A u ([0-9a-f]+) (?:-([0-9a-f]+))? \z }ix) {
264                 my $start = hex($1) << ($2 ? 4 : 8);
265                 my $end = $2 ? (hex($2) << 4) + $row{cols} - 1 : $start + 255;
266                 $row{table} = join '', map { chr } $start .. $end;
267                 utf8::upgrade($row{table});  # prevent latin1 output
268                 $row{endpoint} = $end - $start;
269                 $row{set} = sprintf 'Unicode block U+%02Xxx', $start >> 8;
270                 $row{offset} = $start % 256;
271                 $row{startpoint} = 0;
272         }
273         elsif (lc $input eq 'uu') {
274                 $row{set} = 'Unicode planes';
275                 $row{cell} = do 'charset-ucplanes.inc.pl'
276                         or Alert('Table data could not be read', $@ || $!);
277                 $row{endpoint} ||= 1023;
278                 $row{endpoint}   *= $row{cell}->{colsize};
279                 $row{startpoint} *= $row{cell}->{colsize};
280         }
281         elsif (lc $input eq 'u') {
282                 $row{cell} = do 'charset-unicode.inc.pl'
283                         or Alert('Table data could not be read', $@ || $!);
284
285                 $row{endpoint} ||= 8191;
286                 $row{endpoint}  *= $row{cell}->{colsize};
287                 $row{startpoint} *= $row{cell}->{colsize};
288                 $row{set} = 'Unicode ' . (
289                         $row{startpoint} <  0x10000 && $row{endpoint} < 0x10000 ? 'BMP' :
290                         $row{startpoint} >= 0x10000 && $row{endpoint} < 0x20000 ? 'SMP' :
291                         'allocations'
292                 );
293         }
294         elsif ($input =~ m/^utf-*8$/i) {
295                 $row{set} = 'UTF-8';
296                 $row{cell} = do 'charset-utf8.inc.pl'
297                         or Alert('Table data could not be read', $@ || $!);
298                 $row{endpoint} = 255;
299         }
300         elsif ($row{set} = Encode::resolve_alias($input)) {
301                 $row{offset} = delete $row{startpoint};
302                 $row{endpoint} ||= 255;
303                 if ($row{set} eq 'MacHebrew' or $row{set} eq 'MacThai') {
304                         # array of possibly multiple characters per code point
305                         $row{table} = [
306                                 map { Encode::decode($row{set}, pack 'C*', $_) } $row{offset} .. $row{endpoint}
307                         ];
308                 }
309                 else {
310                         # ~16x faster than decoding in loop;
311                         # substr strings is twice as fast as splitting to an array
312                         $row{table} = Encode::decode($row{set}, pack 'C*', $row{offset} .. $row{endpoint});
313                 }
314
315                 if ($row{set} eq 'cp437') {
316                         if ($row{offset} <= 0xED and $row{endpoint} >= 0xED) {
317                                 # replace phi glyph
318                                 substr($row{table}, 0xED - $row{offset}, 1) = 'ϕ';
319                         }
320                         if ($row{offset} < 0x20) {
321                                 # replace control characters by visible variants
322                                 my $sub = substr ' ☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼', $row{offset};
323                                 substr($row{table}, 0, length $sub) = $sub;
324                         }
325                 }
326                 elsif ($row{set} eq 'symbol') {
327                         if ($row{offset} <= 0x60 and $row{endpoint} >= 0x60) {
328                                 # replace radical extender by closest unicode equivalent
329                                 substr($row{table}, 0x60 - $row{offset},  1) = '│';
330                         }
331                         if ($row{offset} <= 0xBD and $row{endpoint} >= 0xFF) {
332                                 substr($row{table}, 0xBD - $row{offset},  2) = '⏐⎯'; # arrow extenders
333                                 substr($row{table}, 0xD2 - $row{offset},  3) = '®©™'; # serif variants
334                                 substr($row{table}, 0xE0 - $row{offset},  1) = '◊'; # replace lookalike, should match AdobeSymbol
335                                 substr($row{table}, 0xE2 - $row{offset},  3) = '®©™'; # sans-serif variants
336                                 substr($row{table}, 0xE6 - $row{offset}, 10) = '⎛⎜⎝⎡⎢⎣⎧⎨⎩⎪';
337                                 substr($row{table}, 0xF0 - $row{offset},  1) = '€';
338                                 substr($row{table}, 0xF4 - $row{offset}, 11) = '⎮⌡⎞⎟⎠⎤⎥⎦⎫⎬⎭';
339                         }
340                 }
341
342                 $row{endpoint} -= $row{offset};
343
344                 $visible->{ascii} =  # assume common base
345                 $visible->{ $row{set} } = 1;
346         }
347         else {
348                 Alert("Encoding <q>$input</q> unknown");
349                 return;
350         }
351         push @request, \%row;
352 }
353 tabinput($_) for @tablist;
354
355 my $NOCHAR = chr 0xFFFD;
356
357 sub range_cell {
358         my ($info, $offset) = @_;
359         my $table = $info->{cell} or return;
360         my $def = $table->{$offset} or return;
361         my ($len, $class, $name, $title) = @{$def};
362
363         my $cols = $info->{cols};
364         my $colsize = $table->{colsize} || 1;
365         my $attr = '';
366         $len /= $colsize;
367         $name //= $len <= 2 ? 'res' : 'reserved';
368
369         if (my $part = ($offset - $info->{startpoint})/$colsize % $cols) {
370                 # continued row
371                 my $rest = $cols - $part;  # remaining
372                 $rest = $len if $len < $rest; #TODO: optimise
373                 if ($len -= $rest) {
374                         # continued on new row
375                         my @next = ($len * $colsize, "$class joinu");
376                         my $separate = $cols - $len > $rest;  # columns not on next row
377                         if ($len > $rest) {
378                                 # minority remains
379                                 push @next, $name, $title;
380                                 $title ||= $name;
381                                 $name = $separate && '…';
382                         }
383                         else {
384                                 # minority on next row
385                                 push @next, $separate && '"', $title || $name;
386                         }
387                         $table->{$offset + $colsize*$rest} //= \@next;
388                         $class .= ' joind';
389                 }
390                 $len = $rest;
391         }
392         elsif (my $rows = int($len / $cols)) {
393                 # multiple full rows
394                 my $rowsize = $colsize * $cols;
395                 if ($len -= $rows * $cols) {
396                         # partial row remains
397                         $table->{$offset + $rowsize * $rows} //= [$len*$colsize, "$class joinu", '', $title];
398                         $class .= ' joind';
399                 }
400
401                 unless ($info->{realsize}) {
402                         # coalesce multiple rows
403                         while ($rows > 3) {
404                                 $info->{skip}->{$offset += $rowsize}++;
405                                 $rows--;
406                         }
407                         if ($rows > 2) {
408                                 $info->{skip}->{$offset += $rowsize} = 0;
409                         }
410                 }
411
412                 $attr .= sprintf ' rowspan=%d', $rows;
413                 $len = $cols;
414         }
415
416         $attr .= sprintf ' colspan=%d', $len unless $len == 1;
417         $attr .= $1 if $class and $class =~ s/( \w+="[^"]*")//;
418         $attr .= sprintf ' class="%s"', $class if $class;
419         $attr .= sprintf ' title="%s"', EscapeHTML($title) if $title;
420         return "<td$attr>$name\n";
421 }
422
423 for my $row (@request) {
424         my $cols = $row->{cols};
425         my $colsize = $row->{cell} && $row->{cell}->{colsize} || 1;
426         my $coldigits = ceil(log($colsize * $cols) / log(16));  # uniform length of hexadecimal header
427         my $rowdiv = 16 ** $coldigits;  # row divide for column digits
428         $rowdiv = 1 if $rowdiv != $cols * $colsize;  # divide only if all columns are matched
429         my $offset = $row->{startpoint} || 0;
430
431         printf '<div class="section"><table class="glyphs%s">', !$row->{cell} && ' charmap';
432         my $title = $row->{set};
433         $title .= " <aside>(over $_)</aside>"
434                 for $row->{parent} || ();
435         printf '<caption>%s</caption>', $title;
436         print '<col>' x ($cols + 1);
437         for my $section (qw{thead}) {
438                 print "<$section><tr><th>", $rowdiv == 1 ? '+' : '↱';
439                 printf '<th>%0*X', $coldigits, $_ * $colsize for 0 .. $cols - 1;
440                 print "\n";
441         }
442         print '<tbody>';
443         while ($offset < $row->{endpoint}) {
444                 if ($row->{skip}->{$offset}) {
445                         $offset += $cols * $colsize;
446                         next;
447                 }
448
449                 print '<tr><th>';
450                 if (defined $row->{skip}->{$offset}) {
451                         print '⋮';
452                 }
453                 else {
454                         if (my $rowmod = $offset % $rowdiv) {
455                                 # offset in column units
456                                 printf '<small>+%X</small>', $rowmod;
457                         }
458                         else {
459                                 # divided row offset
460                                 printf '%X', ($offset + $row->{offset}) / $rowdiv;
461                         }
462                 }
463                 say '';
464
465                 for (1 .. $cols) {
466                         if ($row->{cell}) {
467                                 print range_cell($row, $offset);
468                                 next;
469                         }
470
471                         my $cp = $offset + $row->{offset};
472                         my $glyph = ref $row->{table} eq 'ARRAY' ? $row->{table}->[$offset] :
473                                 substr $row->{table}, $offset, 1;
474                         my ($cell, $name, $class) = $glyph eq $NOCHAR ? () :
475                                 $glyphs->glyph_html($glyph);
476
477                         if (exists $get{compare}) {
478                                 state $visible = {};
479                                 $class = (
480                                         $cp == ord $glyph ? 'l4' :
481                                         $row->{parent} && $glyph eq
482                                                 Encode::decode($row->{parent}, pack 'C', $cp) ? 'l3' :
483                                         !$class ? undef :
484                                         $visible->{$glyph} ? 'l2' :
485                                         'l1'
486                                 );
487                                 $visible->{$glyph}++;
488                         }
489
490                         say sprintf $class ? '<td title="%s" class="X %s">%s' : '<td title="%s">',
491                                 $name, $class, $cell;
492                 }
493                 continue {
494                         $offset += $colsize;
495                 }
496         }
497         say '</table></div>';
498 }
499
500 :>
501 <hr>
502
503 <div class="legend">
504         <table class="glyphs"><tr><: if (exists $get{compare}) { :>
505         <td class="X l4">unicode
506         <td class="X l3">inherited
507         <td class="X l2">existing
508         <td class="X l1">original
509         <td class="">unassigned
510 <: } else { :>
511         <td class="X Cc">control
512         <td class="X Zs"><span>whitespace</span>
513         <td class="X Mn">diacritic<table class="glyphs"><tr>
514                 <td class="X Sk">letter
515                 </table>
516         <td class="X Po">punctuation<table class="glyphs"><tr>
517                 <td class="X Pf">quote
518                 </table>
519         <td class="X So">symbol<table class="glyphs"><tr>
520                 <td class="X Sm">math
521                 <td class="X Sc">currency
522                 </table>
523         <td class="X No">numeric
524         <td class="X Greek">greek<table class="glyphs"><tr>
525                 <td class="X Latin">latin
526                 <td class="X Cyrillic">cyrillic
527                 </table>
528         <td class="X Aramaic">aramaic<table class="glyphs"><tr>
529                 <td class="X Brahmic">brahmic
530                 <td class="X Arabic">arabic
531                 </table>
532         <td class="X Syllabic">syllabic<table class="glyphs"><tr>
533                 <td class="X African">african
534                 <td class="X Hiragana">japanese
535                 <td class="X Han">cjk
536                 <td class="X Bopomofo">chinese
537                 </table>
538         <td class="X Alpha">alphabetic
539         </table>
540
541         <table class="glyphs"><tr>
542         <td class="X">unicode 7.0
543         <td class="X Xr">proposed
544         <td class="X Xd">deprecated
545         <td class="">unassigned
546         <td class="X Xi">invalid
547 <: } :> </table>
548 </div>
549