6 %{ Data('./charset-encoding') },
10 $row->{offset} = delete $row->{startpoint};
11 $row->{set} = 'Unicode characters';
12 my $block = $row->{offset} >> 8;
13 $row->{endpoint} ||= ($block + 1 << 8) - 1;
14 $block == ($row->{endpoint} >> 8) or undef $block;
16 $row->{table} = join '', map { chr =~ s/\A\p{Unassigned}\z/�/r }
17 $row->{offset} .. $row->{endpoint};
18 utf8::upgrade($row->{table}); # prevent latin1 output
20 $row->{endpoint} -= $row->{offset};
23 $row->{set} = sprintf 'Unicode block U+%02Xxx', $block;
24 $row->{offset} %= 0x100;
31 state $celldata = eval { Data('charset-unicode') }
32 or Alert('Table data could not be read', ref $@ && $@->[1]);
33 $row->{cell} = $celldata;
35 $row->{endpoint} ||= 0x1FFF;
36 $row->{set} = 'Unicode ' . (
37 $row->{startpoint} < 0x1000 && $row->{endpoint} < 0x1000 ? 'BMP' :
38 $row->{startpoint} >= 0x1000 && $row->{endpoint} < 0x2000 ? 'SMP' :
45 $row->{cell} = eval { Data('charset-ucplanes') }
46 or Alert('Table data could not be read', ref $@ && $@->[1]);
47 $row->{endpoint} ||= 0x3FF;
48 $row->{set} = 'Unicode planes';
51 utf8 => {setup => sub {
53 $row->{set} = 'UTF-8';
54 $row->{cell} = eval { Data('charset-utf8') }
55 or Alert('Table data could not be read', ref $@ && $@->[1]);