use utf8

[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";};



posted @ 2016-07-24 13:43  czcb  阅读(126)  评论(0编辑  收藏  举报