[root@wx03 0724]# cat a2.pl
use Encode;
my $a=<STDIN>;
my $b=encode_utf8('微信');
print "\$b is $b\n";
if ($a =~/$b/){print "success\n";};
[root@wx03 0724]# perl a2.pl
23微信2231
$b is 微信
[root@wx03 0724]# cat a2.pl
use Encode;
my $a=<STDIN>;
my $b=encode_utf8('微信');
print "\$b is $b\n";
if ($a =~/$b/){print "success\n";};
/**************************************
[root@wx03 0724]# perl a2.pl
23微信2231
$b is 微信
success
[root@wx03 0724]# cat a2.pl
use Encode;
use utf8;
my $a=<STDIN>;
my $b=encode_utf8('微信');
print "\$b is $b\n";
if ($a =~/$b/){print "success\n";};
use utf8
最新推荐文章于 2020-10-09 14:51:32 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)