charset: code constants in hexadecimal where appropriate
[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                                    +400 +2DE0 +A640-A69F +500-52F )], # MacUkrainian is broken
102                 arabic     => [qw( iso-8859-6 cp1256 MacArabic cp864 cp1006 MacFarsi
103                                    +600 +8A0-8BF+8E0 +750-77F )],
104                 greek      => [qw( iso-8859-7 cp1253 MacGreek cp737 cp869  +370 +1F00 )],
105                 hebrew     => [qw( iso-8859-8 cp1255 MacHebrew cp862  +590 )],
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 >= 0x80;  # 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 eq '') {
265                 $row{offset} = delete $row{startpoint};
266                 $row{set} = 'Unicode characters';
267                 my $block = $row{offset} >> 8;
268                 $row{endpoint} ||= ($block + 1 << 8) - 1;
269                 $block == ($row{endpoint} >> 8) or undef $block;
270
271                 $row{table} = join '', map { chr } $row{offset} .. $row{endpoint};
272                 utf8::upgrade($row{table});  # prevent latin1 output
273
274                 $row{endpoint} -= $row{offset};
275
276                 if (defined $block) {
277                         $row{set} = sprintf 'Unicode block U+%02Xxx', $block;
278                         $row{offset} %= 0x100;
279                 }
280         }
281         elsif (lc $input eq 'uu') {
282                 $row{cell} = do 'charset-ucplanes.inc.pl'
283                         or Alert('Table data could not be read', $@ || $!);
284                 $row{endpoint} ||= 0x3FF;
285                 $row{set} = 'Unicode planes';
286         }
287         elsif (lc $input eq 'u') {
288                 $row{cell} = do 'charset-unicode.inc.pl'
289                         or Alert('Table data could not be read', $@ || $!);
290
291                 $row{endpoint} ||= 0x1FFF;
292                 $row{set} = 'Unicode ' . (
293                         $row{startpoint} <  0x1000 && $row{endpoint} < 0x1000 ? 'BMP' :
294                         $row{startpoint} >= 0x1000 && $row{endpoint} < 0x2000 ? 'SMP' :
295                         'allocations'
296                 );
297         }
298         elsif ($input =~ m/^utf-*8$/i) {
299                 $row{set} = 'UTF-8';
300                 $row{cell} = do 'charset-utf8.inc.pl'
301                         or Alert('Table data could not be read', $@ || $!);
302                 $row{endpoint} = 0xFF;
303         }
304         elsif ($row{set} = Encode::resolve_alias($input)) {
305                 $row{offset} = delete $row{startpoint};
306                 $row{endpoint} ||= 0xFF;
307                 if ($row{set} eq 'MacHebrew' or $row{set} eq 'MacThai') {
308                         # array of possibly multiple characters per code point
309                         $row{table} = [
310                                 map { Encode::decode($row{set}, pack 'C*', $_) } $row{offset} .. $row{endpoint}
311                         ];
312                 }
313                 else {
314                         # ~16x faster than decoding in loop;
315                         # substr strings is twice as fast as splitting to an array
316                         $row{table} = Encode::decode($row{set}, pack 'C*', $row{offset} .. $row{endpoint});
317                 }
318
319                 if ($row{set} eq 'cp437') {
320                         if ($row{offset} <= 0xED and $row{endpoint} >= 0xED) {
321                                 # replace phi glyph
322                                 substr($row{table}, 0xED - $row{offset}, 1) = 'ϕ';
323                         }
324                         if ($row{offset} < 0x20) {
325                                 # replace control characters by visible variants
326                                 my $sub = substr ' ☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼', $row{offset};
327                                 substr($row{table}, 0, length $sub) = $sub;
328                         }
329                 }
330                 elsif ($row{set} eq 'symbol') {
331                         if ($row{offset} <= 0x60 and $row{endpoint} >= 0x60) {
332                                 # replace radical extender by closest unicode equivalent
333                                 substr($row{table}, 0x60 - $row{offset},  1) = '│';
334                         }
335                         if ($row{offset} <= 0xBD and $row{endpoint} >= 0xFF) {
336                                 substr($row{table}, 0xBD - $row{offset},  2) = '⏐⎯'; # arrow extenders
337                                 substr($row{table}, 0xD2 - $row{offset},  3) = '®©™'; # serif variants
338                                 substr($row{table}, 0xE0 - $row{offset},  1) = '◊'; # replace lookalike, should match AdobeSymbol
339                                 substr($row{table}, 0xE2 - $row{offset},  3) = '®©™'; # sans-serif variants
340                                 substr($row{table}, 0xE6 - $row{offset}, 10) = '⎛⎜⎝⎡⎢⎣⎧⎨⎩⎪';
341                                 substr($row{table}, 0xF0 - $row{offset},  1) = '€';
342                                 substr($row{table}, 0xF4 - $row{offset}, 11) = '⎮⌡⎞⎟⎠⎤⎥⎦⎫⎬⎭';
343                         }
344                 }
345
346                 $row{endpoint} -= $row{offset};
347
348                 $visible->{ascii} =  # assume common base
349                 $visible->{ $row{set} } = 1;
350         }
351         else {
352                 Alert("Encoding <q>$input</q> unknown");
353                 return;
354         }
355         push @request, \%row;
356 }
357 tabinput($_) for @tablist;
358
359 my $NOCHAR = chr 0xFFFD;
360
361 sub range_cell {
362         my ($info, $offset) = @_;
363         my $table = $info->{cell} or return;
364         my $def = $table->{$offset} or return;
365         my ($len, $class, $name, $title) = @{$def};
366
367         my $cols = $info->{cols};
368         my $colsize = $table->{colsize} || 1;
369         my $attr = '';
370         $len /= $colsize;
371         $name //= $len <= 2 ? 'res' : 'reserved';
372
373         if (my $part = ($offset/$colsize - $info->{startpoint}) % $cols) {
374                 # continued row
375                 my $rest = $cols - $part;  # remaining
376                 $rest = $len if $len < $rest; #TODO: optimise
377                 if ($len -= $rest) {
378                         # continued on new row
379                         my @next = ($len * $colsize, "$class joinu");
380                         my $separate = $cols - $len > $rest;  # columns not on next row
381                         if ($len > $rest) {
382                                 # minority remains
383                                 push @next, $name, $title;
384                                 $title ||= $name;
385                                 $name = $separate && '…';
386                         }
387                         else {
388                                 # minority on next row
389                                 push @next, $separate && '"', $title || $name;
390                         }
391                         $table->{$offset + $colsize*$rest} //= \@next;
392                         $class .= ' joind';
393                 }
394                 $len = $rest;
395         }
396         elsif (my $rows = int($len / $cols)) {
397                 # multiple full rows
398                 my $rowsize = $colsize * $cols;
399                 if ($len -= $rows * $cols) {
400                         # partial row remains
401                         $table->{$offset + $rowsize * $rows} //= [$len*$colsize, "$class joinu", '', $title];
402                         $class .= ' joind';
403                 }
404
405                 unless ($info->{realsize}) {
406                         # coalesce multiple rows
407                         while ($rows > 3) {
408                                 $info->{skip}->{$offset += $rowsize}++;
409                                 $rows--;
410                         }
411                         if ($rows > 2) {
412                                 $info->{skip}->{$offset += $rowsize} = 0;
413                         }
414                 }
415
416                 $attr .= sprintf ' rowspan=%d', $rows;
417                 $len = $cols;
418         }
419
420         $attr .= sprintf ' colspan=%d', $len unless $len == 1;
421         $attr .= $1 if $class and $class =~ s/( \w+="[^"]*")//;
422         $attr .= sprintf ' class="%s"', $class if $class;
423         $attr .= sprintf ' title="%s"', EscapeHTML($title) if $title;
424         return "<td$attr>$name\n";
425 }
426
427 for my $row (@request) {
428         my $cols = $row->{cols};
429         my $colsize = $row->{cell} && $row->{cell}->{colsize} || 1;
430         my $coldigits = ceil(log($colsize * $cols) / log(16));  # uniform length of hexadecimal header
431         my $rowdiv = 16 ** $coldigits;  # row divide for column digits
432         $rowdiv = 1 if $rowdiv != $cols * $colsize;  # divide only if all columns are matched
433         my $offset = $row->{startpoint} * $colsize || 0;
434
435         printf '<div class="section"><table class="glyphs%s">', !$row->{cell} && ' charmap';
436         my $title = $row->{set};
437         $title .= " <aside>(over $_)</aside>"
438                 for $row->{parent} || ();
439         printf '<caption>%s</caption>', $title;
440         print '<col>' x ($cols + 1);
441         for my $section (qw{thead}) {
442                 print "<$section><tr><th>", $rowdiv == 1 ? '+' : '↱';
443                 printf '<th>%0*X', $coldigits, $_ * $colsize for 0 .. $cols - 1;
444                 print "\n";
445         }
446
447         print '<tbody>';
448         while ($offset <= $row->{endpoint} * $colsize) {
449                 if ($row->{skip}->{$offset}) {
450                         $offset += $cols * $colsize;
451                         next;
452                 }
453
454                 print '<tr><th>';
455                 if (defined $row->{skip}->{$offset}) {
456                         print '⋮';
457                 }
458                 else {
459                         if (my $rowmod = $offset % $rowdiv) {
460                                 # offset in column units
461                                 printf '<small>+%X</small>', $rowmod;
462                         }
463                         else {
464                                 # divided row offset
465                                 printf '%X', ($offset + $row->{offset}) / $rowdiv;
466                         }
467                 }
468                 say '';
469
470                 for (1 .. $cols) {
471                         if ($row->{cell}) {
472                                 print range_cell($row, $offset);
473                                 next;
474                         }
475
476                         my $cp = $offset + $row->{offset};
477                         my $glyph = ref $row->{table} eq 'ARRAY' ? $row->{table}->[$offset] :
478                                 substr $row->{table}, $offset, 1;
479                         my ($cell, $name, $class) = $glyph eq $NOCHAR ? () :
480                                 $glyphs->glyph_html($glyph);
481
482                         if (exists $get{compare}) {
483                                 state $visible = {};
484                                 $class = (
485                                         $cp == ord $glyph ? 'l4' :
486                                         $row->{parent} && $glyph eq
487                                                 Encode::decode($row->{parent}, pack 'C', $cp) ? 'l3' :
488                                         !$class ? undef :
489                                         $visible->{$glyph} ? 'l2' :
490                                         'l1'
491                                 );
492                                 $visible->{$glyph}++;
493                         }
494
495                         say sprintf $class ? '<td title="%s" class="X %s">%s' : '<td title="%s">',
496                                 $name, $class, $cell;
497                 }
498                 continue {
499                         $offset += $colsize;
500                 }
501         }
502         say '</table></div>';
503 }
504
505 :>
506 <hr>
507
508 <div class="legend">
509         <table class="glyphs"><tr><: if (exists $get{compare}) { :>
510         <td class="X l4">unicode
511         <td class="X l3">inherited
512         <td class="X l2">existing
513         <td class="X l1">original
514         <td class="">unassigned
515 <: } else { :>
516         <td class="X Cc">control
517         <td class="X Zs"><span>whitespace</span>
518         <td class="X Mn">diacritic<table class="glyphs"><tr>
519                 <td class="X Sk">letter
520                 </table>
521         <td class="X Po">punctuation<table class="glyphs"><tr>
522                 <td class="X Pf">quote
523                 </table>
524         <td class="X So">symbol<table class="glyphs"><tr>
525                 <td class="X Sm">math
526                 <td class="X Sc">currency
527                 </table>
528         <td class="X No">numeric
529         <td class="X Greek">greek<table class="glyphs"><tr>
530                 <td class="X Latin">latin
531                 <td class="X Cyrillic">cyrillic
532                 </table>
533         <td class="X Aramaic">aramaic<table class="glyphs"><tr>
534                 <td class="X Brahmic">brahmic
535                 <td class="X Arabic">arabic
536                 </table>
537         <td class="X Syllabic">syllabic<table class="glyphs"><tr>
538                 <td class="X African">african
539                 <td class="X Hiragana">japanese
540                 <td class="X Han">cjk
541                 <td class="X Bopomofo">chinese
542                 </table>
543         <td class="X Alpha">alphabetic
544         </table>
545
546         <table class="glyphs"><tr>
547         <td class="X">unicode 7.0
548         <td class="X Xr">proposed
549         <td class="X Xd">deprecated
550         <td class="">unassigned
551         <td class="X Xi">invalid
552 <: } :> </table>
553 </div>
554