开发者

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

开发者 https://www.devze.com 2023-02-14 06:04 出处:网络
#!/usr/bin/env perl use warnings; use 5.012; binmode STDOUT, \':encoding(utf-8)\'; for ( 0 .. 10000 ) { print chr, \' \';
#!/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

精彩评论

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