开发者

How could I filter out codepoints before printing, which are not available on my computer?

#!/usr/bin/env perl
use warnings;
use 5.012;
binmode STDOUT, ':encoding(utf-8)';

for ( 0 .. 10000 ) {
    print chr, ' ';
开发者_JAVA技巧}
say "";

Is it possible to filter out the code-points in this loop before printing, which would be printed as spaces or rectangles. ( I tried to copy some rectangles as example, but here in the browser they transform to nice signs ).


No, you can't know this. It’s a function of the fonts available in the program displaying the text. There’s no way for Perl to know what that program’s font-replacement strategy is.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜