charset: compare unknown glyphs in custom tables
[sheet.git] / charset-encoding.inc.pl
index 2da7614623044f5f0e878acacc7ede49f9661306..b5345101f966b750c167a8690f9fa5d5f85d481f 100644 (file)
@@ -271,7 +271,8 @@ use utf8;
                $row->{endpoint} ||= ($block + 1 << 8) - 1;
                $block == ($row->{endpoint} >> 8) or undef $block;
 
-               $row->{table} = join '', map { chr } $row->{offset} .. $row->{endpoint};
+               $row->{table} = join '', map { chr =~ s/\A\p{Unassigned}\z/�/r }
+                       $row->{offset} .. $row->{endpoint};
                utf8::upgrade($row->{table});  # prevent latin1 output
 
                $row->{endpoint} -= $row->{offset};